Code Monkey home page Code Monkey logo

Comments (10)

sathishkumar555 avatar sathishkumar555 commented on June 11, 2024 1

@parag3638 , Remove the NEXT_PRIVATE_LOCAL_WEBPACK = true from the dev and build scripts in the package.json file. Instead, create a .env file and add the NEXT_PRIVATE_LOCAL_WEBPACK = true

from module-federation-examples.

sathishkumar555 avatar sathishkumar555 commented on June 11, 2024 1

@parag3638 , I am also getting the same error. Please check this issue #3621

from module-federation-examples.

ScriptedAlchemy avatar ScriptedAlchemy commented on June 11, 2024 1

NEXT_PRIVATE_LOCAL_WEBPACK=true next dev

from module-federation-examples.

parag3638 avatar parag3638 commented on June 11, 2024

@sathishkumar555 It worked but now I am stuck with this....

Error: Cannot find module 'C:\Users\H532304.GLOBAL\Desktop\ABC\test\remote\node_modules\next\dist\compiled\lib\util\makeSerializable'
Require stack:

  • C:\Users\H532304.GLOBAL\Desktop\ABC\test\remote\node_modules@module-federation\enhanced\dist\src\lib\container\ContainerExposedDependency.js
  • C:\Users\H532304.GLOBAL\Desktop\ABC\test\remote\node_modules@module-federation\enhanced\dist\src\lib\container\ContainerEntryModule.js
  • C:\Users\H532304.GLOBAL\Desktop\ABC\test\remote\node_modules@module-federation\enhanced\dist\src\lib\container\HoistContainerReferencesPlugin.js
  • C:\Users\H532304.GLOBAL\Desktop\ABC\test\remote\node_modules@module-federation\enhanced\dist\src\wrapper\HoistContainerReferencesPlugin.js
  • C:\Users\H532304.GLOBAL\Desktop\ABC\test\remote\node_modules@module-federation\enhanced\dist\src\index.js
  • C:\Users\H532304.GLOBAL\Desktop\ABC\test\remote\node_modules@module-federation\nextjs-mf\dist\src\internal.js
  • C:\Users\H532304.GLOBAL\Desktop\ABC\test\remote\node_modules@module-federation\nextjs-mf\dist\src\plugins\NextFederationPlugin\next-fragments.js
  • C:\Users\H532304.GLOBAL\Desktop\ABC\test\remote\node_modules@module-federation\nextjs-mf\dist\src\plugins\NextFederationPlugin\index.js
  • C:\Users\H532304.GLOBAL\Desktop\ABC\test\remote\node_modules@module-federation\nextjs-mf\dist\src\index.js
  • C:\Users\H532304.GLOBAL\Desktop\ABC\test\remote\next.config.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
    at C:\Users\H532304.GLOBAL\Desktop\ABC\test\remote\node_modules\next\dist\server\require-hook.js:55:36
    at Module._load (node:internal/modules/cjs/loader:985:27)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at mod.require (C:\Users\H532304.GLOBAL\Desktop\ABC\test\remote\node_modules\next\dist\server\require-hook.js:65:28)
    at require (node:internal/modules/helpers:176:18)
    at Object. (C:\Users\H532304.GLOBAL\Desktop\ABC\test\remote\node_modules@module-federation\enhanced\dist\src\lib\container\ContainerExposedDependency.js:8:26)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Module.load (node:internal/modules/cjs/loader:1207:32) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    'C:\Users\H532304.GLOBAL\Desktop\ABC\test\remote\node_modules\@module-federation\enhanced\dist\src\lib\container\ContainerExposedDependency.js',
    'C:\Users\H532304.GLOBAL\Desktop\ABC\test\remote\node_modules\@module-federation\enhanced\dist\src\lib\container\ContainerEntryModule.js',
    'C:\Users\H532304.GLOBAL\Desktop\ABC\test\remote\node_modules\@module-federation\enhanced\dist\src\lib\container\HoistContainerReferencesPlugin.js',
    'C:\Users\H532304.GLOBAL\Desktop\ABC\test\remote\node_modules\@module-federation\enhanced\dist\src\wrapper\HoistContainerReferencesPlugin.js',
    'C:\Users\H532304.GLOBAL\Desktop\ABC\test\remote\node_modules\@module-federation\enhanced\dist\src\index.js',
    'C:\Users\H532304.GLOBAL\Desktop\ABC\test\remote\node_modules\@module-federation\nextjs-mf\dist\src\internal.js',
    'C:\Users\H532304.GLOBAL\Desktop\ABC\test\remote\node_modules\@module-federation\nextjs-mf\dist\src\plugins\NextFederationPlugin\next-fragments.js',
    'C:\Users\H532304.GLOBAL\Desktop\ABC\test\remote\node_modules\@module-federation\nextjs-mf\dist\src\plugins\NextFederationPlugin\index.js',
    'C:\Users\H532304.GLOBAL\Desktop\ABC\test\remote\node_modules\@module-federation\nextjs-mf\dist\src\index.js',
    'C:\Users\H532304.GLOBAL\Desktop\ABC\test\remote\next.config.js'
    ]
    }

from module-federation-examples.

OscarJVD avatar OscarJVD commented on June 11, 2024

Same error with next v14. Help!

from module-federation-examples.

ScriptedAlchemy avatar ScriptedAlchemy commented on June 11, 2024

put it in both .env and on the command line.

https://github.com/vercel/next.js/blob/135642b9df800433b42876f777f486aa3b610b93/packages/next/src/compiled/webpack/webpack.js#L6

Otherwise file git issue with vercel.

from module-federation-examples.

sreeharinm avatar sreeharinm commented on June 11, 2024

put it in both .env and on the command line.

https://github.com/vercel/next.js/blob/135642b9df800433b42876f777f486aa3b610b93/packages/next/src/compiled/webpack/webpack.js#L6

Otherwise file git issue with vercel.

where should i add this
in next.js there is no such file cale called webpack.js

from module-federation-examples.

sreeharinm avatar sreeharinm commented on June 11, 2024
Screenshot 2024-04-25 114747

error still showing

NEXT_PRIVATE_LOCAL_WEBPACK=true next dev

from module-federation-examples.

widipa avatar widipa commented on June 11, 2024

I have the same problem, I comment what I have done to see if they can help me.

Create both Home and Reomte project with NextJS 14 + Typescript + App Router (/src/app/page.tsx)

I made the configuration indicated in this article: https://medium.com/@sarathdixit29/implementing-module-federation-in-next-js-with-typescript-and-eslint-ba6627a0686f

If I run it like this: npm run dev it gives me the same error as the friend who started this thread.

If I change the next.config.mjs file and pass it to anext.config.js and adjust the content as the article says and execute it and now I get this error:

npm run dev

[email protected] dev
next dev -p 3001

(node:25736) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ... to show where the warning was created)
▲Next.js 14.2.3

✓ Starting...
(node:8476) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ... to show where the warning was created)
Error: App Directory is not supported by nextjs-mf. Use only pages directory, do not open git issues about this
at NextFederationPlugin.validateOptions (D:\Dev\workspace\ws-mentor-it\nextjs\module-federation\remote-app\node_modules@module-federation\nextjs-mf\dist\src\plugins\NextFederationPlugin\index.js :67:23)
at NextFederationPlugin.apply (D:\Dev\workspace\ws-mentor-it\nextjs\module-federation\remote-app\node_modules@module-federation\nextjs-mf\dist\src\plugins\NextFederationPlugin\index.js :45:19)
at createCompiler (D:\Dev\workspace\ws-mentor-it\nextjs\module-federation\remote-app\node_modules\next\dist\compiled\webpack\bundle5.js:28:1467450)
at D:\Dev\workspace\ws-mentor-it\nextjs\module-federation\remote-app\node_modules\next\dist\compiled\webpack\bundle5.js:28:1467068
at Array.map ()
at createMultiCompiler (D:\Dev\workspace\ws-mentor-it\nextjs\module-federation\remote-app\node_modules\next\dist\compiled\webpack\bundle5.js:28:1467060)
at create (D:\Dev\workspace\ws-mentor-it\nextjs\module-federation\remote-app\node_modules\next\dist\compiled\webpack\bundle5.js:28:1467932)
at webpack (D:\Dev\workspace\ws-mentor-it\nextjs\module-federation\remote-app\node_modules\next\dist\compiled\webpack\bundle5.js:28:1468341)
at f (D:\Dev\workspace\ws-mentor-it\nextjs\module-federation\remote-app\node_modules\next\dist\compiled\webpack\bundle5.js:28:895636)
at HotReloaderWebpack.start (D:\Dev\workspace\ws-mentor-it\nextjs\module-federation\remote-app\node_modules\next\dist\server\dev\hot-reloader-webpack.js:859:51)

How do I make it not look in the "pages" folder but instead look for them in src/app/page.tsx?

from module-federation-examples.

ScriptedAlchemy avatar ScriptedAlchemy commented on June 11, 2024

Delete the app folder and only use pages.

from module-federation-examples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.