编译使用代码的页面时:
我得到:
error - /Users/m.schmidt/Development/cloud-apps/packages/graphql-server/dist/index.js 37:24
Module parse failed: Unexpected token (37:24)
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
| // grab local ngrok endpoint for development
| if (process.env.NODE_ENV !== 'production' &&
> process.env.AC_OPTS?.includes('force-reg') &&
| !process.env.AC_LOCAL_BASE_URL) {
| const ngrokUrl = fs_1.default.readFileSync('/.ngrok_url').toString();
这看起来很像 nodejs 版本不匹配。但是 console.log 的模块加载输出是:
11.11 https://nodejs.org/download/release/v14.16.0/node-v14.16.0.tar.gz packages/graphql-server/src/index.ts:32
所以它是节点 14,它应该能够理解?
Nextjs 版本是 10.0.8。
nextjs 抛出此 Module Parse failed 错误的原因可能是什么?