-
-
Notifications
You must be signed in to change notification settings - Fork 570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
million/compiler
failed to check nextjs app
dir inside src
dir
#958
Comments
Thanks for opening this issue! A maintainer will review it soon. |
I thought it was happening only for either localized or multi plugin projects cause: /** @type {import('next').NextConfig} */
import createNextIntlPlugin from "next-intl/plugin";
import million from "million/compiler";
const withNextIntl = createNextIntlPlugin();
const millionConfig = {
auto: true,
};
const nextConfig = {
experimental: {
instrumentationHook: true,
},
webpack(config, { isServer }) {
if (isServer) {
if (Array.isArray(config.resolve.alias)) {
config.resolve.alias.push({ name: "msw/browser", alias: false });
} else {
config.resolve.alias["msw/browser"] = false;
}
} else {
if (Array.isArray(config.resolve.alias)) {
config.resolve.alias.push({ name: "msw/node", alias: false });
} else {
config.resolve.alias["msw/node"] = false;
}
}
return config;
},
productionBrowserSourceMaps: true,
reactStrictMode: true,
};
export default million.next(withNextIntl(nextConfig, millionConfig)); It was failing on loading. After applying the workaround, running dev does fail anymore, even if we use It is very weird. |
@SalahAdDin I don't think that is the correct way to use the export default million.next(withNextIntl(nextConfig), millionConfig); You don't need to use this workaround if your project doesn't use RSC. The workaround only useful for the project that using |
Well, You made me the key to remember the issue: pnpm dev ✔ 20.11.0
> global-web-fe@0.1.0 dev /home/luisalaguna/Projects/TRT/twe_fe_next
> next dev
▲ Next.js 14.1.0
- Local: http://localhost:3000
- Experiments (use at your own risk):
· instrumentationHook
✓ Ready in 2.3s
⚠ Found a change in next.config.mjs. Restarting the server to apply the changes...
▲ Next.js 14.1.0
- Local: http://localhost:3000
- Experiments (use at your own risk):
· instrumentationHook
✓ Ready in 2.1s
✓ Compiled /src/middleware in 314ms (86 modules)
⚡ Million.js 3.0.3
- Tip: use // million-ignore for errors
- Hotline: https://million.dev/hotline
○ Compiling /[locale] ...
✓ Compiled /[locale] in 4s (1060 modules)
⨯ node_modules/.pnpm/@radix-ui+react-direction@1.0.1_@types+react@18.2.55_react@18.2.0/node_modules/@radix-ui/react-direction/dist/index.mjs (4:82) @ undefined
⨯ TypeError: (0 , react__WEBPACK_IMPORTED_MODULE_0__.createContext) is not a function
at eval (webpack-internal:///(rsc)/./node_modules/.pnpm/@radix-ui+react-direction@1.0.1_@types+react@18.2.55_react@18.2.0/node_modules/@radix-ui/react-direction/dist/index.mjs:9:114)
at (rsc)/./node_modules/.pnpm/@radix-ui+react-direction@1.0.1_@types+react@18.2.55_react@18.2.0/node_modules/@radix-ui/react-direction/dist/index.mjs (/home/luisalaguna/Projects/TRT/twe_fe_next/.next/server/vendor-chunks/@radix-ui+react-direction@1.0.1_@types+react@18.2.55_react@18.2.0.js:20:1)
at __webpack_require__ (/home/luisalaguna/Projects/TRT/twe_fe_next/.next/server/webpack-runtime.js:33:42)
at eval (webpack-internal:///(rsc)/./src/app/[locale]/layout.tsx:11:83)
at (rsc)/./src/app/[locale]/layout.tsx (/home/luisalaguna/Projects/TRT/twe_fe_next/.next/server/app/[locale]/page.js:237:1)
at Function.__webpack_require__ (/home/luisalaguna/Projects/TRT/twe_fe_next/.next/server/webpack-runtime.js:33:42)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async collectGenerateParams (/home/luisalaguna/Projects/TRT/twe_fe_next/node_modules/.pnpm/next@14.1.0_@babel+core@7.23.9_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/build/utils.js:919:21)
at async Object.loadStaticPaths (/home/luisalaguna/Projects/TRT/twe_fe_next/node_modules/.pnpm/next@14.1.0_@babel+core@7.23.9_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/server/dev/static-paths-worker.js:46:13) {
type: 'TypeError',
page: '/en'
}
null
○ Compiling /_error ...
✓ Compiled /_error in 3.5s (1167 modules) It happens when we use When we use So, it is not a workaround in this case. WorkaroundOur solution is Update:Now, it does not work, again! |
@SalahAdDin As I said in the workaround you need to manually set export default million.next(withNextIntl(nextConfig), { auto: { rsc: true }, rsc: true });
|
Not working for me: - Experiments (use at your own risk):
· auto-rsc
✓ Compiled /[locale] in 6.9s (1051 modules)
⨯ node_modules/.pnpm/@radix-ui+react-direction@1.0.1_@types+react@18.2.55_react@18.2.0/node_modules/@radix-ui/react-direction/dist/index.mjs (4:82) @ undefined
⨯ TypeError: (0 , react__WEBPACK_IMPORTED_MODULE_0__.createContext) is not a function
at eval (webpack-internal:///(rsc)/./node_modules/.pnpm/@radix-ui+react-direction@1.0.1_@types+react@18.2.55_react@18.2.0/node_modules/@radix-ui/react-direction/dist/index.mjs:9:114)
at (rsc)/./node_modules/.pnpm/@radix-ui+react-direction@1.0.1_@types+react@18.2.55_react@18.2.0/node_modules/@radix-ui/react-direction/dist/index.mjs (/home/luisalaguna/Projects/TRT/twe_fe_next/.next/server/vendor-chunks/@radix-ui+react-direction@1.0.1_@types+react@18.2.55_react@18.2.0.js:20:1)
at __webpack_require__ (/home/luisalaguna/Projects/TRT/twe_fe_next/.next/server/webpack-runtime.js:33:42)
at eval (webpack-internal:///(rsc)/./src/app/[locale]/layout.tsx:10:83)
at (rsc)/./src/app/[locale]/layout.tsx (/home/luisalaguna/Projects/TRT/twe_fe_next/.next/server/app/[locale]/page.js:237:1)
at Function.__webpack_require__ (/home/luisalaguna/Projects/TRT/twe_fe_next/.next/server/webpack-runtime.js:33:42)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async collectGenerateParams (/home/luisalaguna/Projects/TRT/twe_fe_next/node_modules/.pnpm/next@14.1.0_@babel+core@7.23.9_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/build/utils.js:919:21)
at async Object.loadStaticPaths (/home/luisalaguna/Projects/TRT/twe_fe_next/node_modules/.pnpm/next@14.1.0_@babel+core@7.23.9_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/server/dev/static-paths-worker.js:46:13) {
type: 'TypeError',
page: '/en'
}
null
○ Compiling /_error ...
✓ Compiled /_error in 2.3s (1158 modules)
⨯ node_modules/.pnpm/@radix-ui+react-direction@1.0.1_@types+react@18.2.55_react@18.2.0/node_modules/@radix-ui/react-direction/dist/index.mjs (4:82) @ undefined
⨯ TypeError: (0 , react__WEBPACK_IMPORTED_MODULE_0__.createContext) is not a function
at eval (webpack-internal:///(rsc)/./node_modules/.pnpm/@radix-ui+react-direction@1.0.1_@types+react@18.2.55_react@18.2.0/node_modules/@radix-ui/react-direction/dist/index.mjs:9:114)
at (rsc)/./node_modules/.pnpm/@radix-ui+react-direction@1.0.1_@types+react@18.2.55_react@18.2.0/node_modules/@radix-ui/react-direction/dist/index.mjs (/home/luisalaguna/Projects/TRT/twe_fe_next/.next/server/vendor-chunks/@radix-ui+react-direction@1.0.1_@types+react@18.2.55_react@18.2.0.js:20:1)
at __webpack_require__ (/home/luisalaguna/Projects/TRT/twe_fe_next/.next/server/webpack-runtime.js:33:42)
at eval (webpack-internal:///(rsc)/./src/app/[locale]/layout.tsx:10:83)
at (rsc)/./src/app/[locale]/layout.tsx (/home/luisalaguna/Projects/TRT/twe_fe_next/.next/server/app/[locale]/page.js:237:1)
at Function.__webpack_require__ (/home/luisalaguna/Projects/TRT/twe_fe_next/.next/server/webpack-runtime.js:33:42)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async collectGenerateParams (/home/luisalaguna/Projects/TRT/twe_fe_next/node_modules/.pnpm/next@14.1.0_@babel+core@7.23.9_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/build/utils.js:919:21)
at async Object.loadStaticPaths (/home/luisalaguna/Projects/TRT/twe_fe_next/node_modules/.pnpm/next@14.1.0_@babel+core@7.23.9_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/server/dev/static-paths-worker.js:46:13) {
type: 'TypeError',
page: '/en'
}
null |
@SalahAdDin Then I think it's not related to the issue. From the error, it seems like you're using |
Well, it is working well after removing the provider. In your opinion this workaround should not be required, right? Thank you! |
@SalahAdDin The workaround is required if you're using |
But it should be working without the workaround, right? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within the next 7 days. |
@aidenybai any news on this issue? |
bump here, same issue -- anyone got around this? |
bump |
Workaround doesn't work for me on Nextjs 14 with app dir inside src. |
Can I see the config? |
I think it actually has to do with the type of NextConfig being passed to million.next.
|
My project also has several plugins and uses src/app/[locale] structure. I tried to pass it like that :
as soon as i changed it to this it started working:
My next.config.mjs :
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within the next 7 days. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within the next 7 days. |
Up! |
Are you still experiencing this issue @SalahAdDin? It should have been fixed by now. |
Is there any new release? I can't see it here. |
@SalahAdDin With the latest release of next.js and million.js, it seems like this has not been fixed yet. |
Same issue |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within the next 7 days. |
Yeah, we are still experiencing the issue. |
agreed with @IamSoPrada I could only get it work this way with the latest version of nextjs "next": "14.2.3",
With out this I get this error Module not found: Can't resolve '/myproject/src/app/dashboard/layout.tsx' |
What version of
million
are you using?3.0.3
Are you using an SSR adapter? If so, which one?
None
What package manager are you using?
pnpm
What operating system are you using?
Mac
What browser are you using?
Chrome
Describe the Bug
million/compiler
failed to auto-determine whether the user is usingapp
dir insidesrc
dir. This caused the compiler to fail to compile RSC.million/packages/compiler/index.ts
Line 35 in ec34eba
What's the expected result?
The compiler should correctly determine whether the user is using
app
dir insidesrc
dir or not.Workaround
Manually set
CompilerOptions.rsc
totrue
.Link to Minimal Reproducible Example
https://stackblitz.com/edit/stackblitz-starters-vmkrup
Participation
The text was updated successfully, but these errors were encountered: