NextJS中的Esbuild:“您可能需要一个适当的加载程序来处理此文件类型” - /node_modules/esbuild/lib/main.d.ts
我正在Next.js中使用MDX-Bundler(使用Esbuild + Node-GYP)。我已经从事这个项目了一段时间,一切都在起作用。现在,我的伴侣只是克隆了存储库,并试图使其正常工作,但她得到了:
../../node_modules/esbuild/lib/main.d.ts
Module parse failed: Unexpected token (1:7)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> export type Platform = 'browser' | 'node' | 'neutral';
| export type Format = 'iife' | 'cjs' | 'esm';
| export type Loader = 'js' | 'jsx' | 'ts' | 'tsx' | 'css' | 'json' | 'text' | 'base64' | 'file' | 'dataurl' | 'binary' | 'default';
我不确定这会是什么。我已经安装了所有装载机等。它在我的机器上工作正常。 Esbuild可能有问题吗?
我们还检查了安装在另一台计算机上的全局NPM软件包,并卸载并安装了与我拥有的完全相同的版本。
我们还尝试通过nvm
使用不同的节点版本,并确保她使用完全相同的节点版本。
我不知道该怎么办,或者可能存在什么问题?
这是一个非常相似的错误,这也与mdx-bundler&amp&amp&amp&amp&amp&amp&amp&amp&amp&amp&amp&amp&amp&amp&amp。 ; Esbuild
I am using mdx-bundler (which uses esbuild + node-gyp) in next.js. I have been working on this project for some time and everything is working. Now my partner just cloned the repo and tried to get it working but she gets:
../../node_modules/esbuild/lib/main.d.ts
Module parse failed: Unexpected token (1:7)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> export type Platform = 'browser' | 'node' | 'neutral';
| export type Format = 'iife' | 'cjs' | 'esm';
| export type Loader = 'js' | 'jsx' | 'ts' | 'tsx' | 'css' | 'json' | 'text' | 'base64' | 'file' | 'dataurl' | 'binary' | 'default';
I am not sure what this could be. I have all the loaders installed etc. and it is working fine on my machine. Is there something wrong with esbuild maybe?
We also checked the global npm packages installed on that other machine and have uninstalled and installed exactly the same versions that I have.
We also tried using different node versions via nvm
, and made sure she uses the exact same node version.
I don't know what else to do or what the problem could be here?
Here is a desription of a very similar error, that also has to do with mdx-bundler & esbuild
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论