question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot find module, when running in Windows enviroment

See original GitHub issue

A project that is a exact clone from Jack Harrington’s nextjs-mf. Nothing has changed. But when I try to run in Windows (only), I got this error: error

But when running in linux, everything goes well.

The path in next.config.js

        // For SSR, resolve to disk path (or you can use code streaming if you have access)
        home: isServer
          ? path.resolve(
              __dirname,
              "../home/.next/server/static/runtime/remoteEntry.js"
            )
          : "home", // for client, treat it as a global
      }```

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:7

github_iconTop GitHub Comments

5reactions
hugocalheiracommented, Jan 18, 2021

Well I found a workaround…

image https://github.com/sindresorhus/slash

So, I add this to the project yarn add slash and resolve my pdp/next.config.js like this: image

Finally, my pdp app run with the Header component from home! image

2reactions
bravoy93commented, Mar 22, 2021

@hugocalheira you are a Crack! I had been trying to solve this error for about 5 days. Thank you very much for sharing man!! 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - Nodejs cannot find installed module on Windows
The answer for windows 10 is to set the NODE_PATH in the enviroment variables with C:\Users\User\node_modules. Share.
Read more >
Error Nodejs cannot find installed module on Windows
I am learning nodejs at the moment on Windows. Several modules are installed globally with npm.cmd, and nodejs failed to find the installed ......
Read more >
[Node.js 12.11+ and Windows 10] Error: Cannot find module ...
My use case: I have TypeScript projects that are coded as ES modules (for example: cedx/coveralls.js or cedx/which.js).
Read more >
Fix Global Installs Not Working | "Cannot find module" error FIX
Getting " Cannot find module " after installing something globally (with -g)? Well, this video shows you how to fix global package/module ...
Read more >
Error on starting computer - Cannot find module
... starting my computer running on windows 7 : can not find module- ... A message will appear stating that 'The system scan...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found