[Resolved] SSR not possible due to `lodash-es`
See original GitHub issueHi,
After having successfully used this package in a standard react
setting, I was trying to port that code to next.js
to enable some Server-Side rendering, when the following error was thrown:
[...]/node_modules/lodash-es/isNumber.js:1
import baseGetTag from './_baseGetTag.js';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at Module._compile (internal/modules/cjs/loader.js:895:18)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
at Module.load (internal/modules/cjs/loader.js:815:32)
at Function.Module._load (internal/modules/cjs/loader.js:727:14)
at Module.require (internal/modules/cjs/loader.js:852:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> ([...]/node_modules/react-d3-speedometer/dist/core/util/index.js:1:616)
at Module._compile (internal/modules/cjs/loader.js:959:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
at Module.load (internal/modules/cjs/loader.js:815:32)
It appears from the Changelog that normal lodash
was replaced not that long ago, without significant changes since, so I was able to downgrade to 0.10.1
without much issue but thought I’d post a shout as an FYI, for future design consideration, or other people running into this.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
SSR Externals False Positive on Windows #2393 - vitejs/vite
The path requireEntry comes from require.resolve which is not normalized. ... This leads to a false positive, thinking the package has a cjs...
Read more >Module not found: Error: Can't resolve 'cypress/types/lodash
I am running my first test in Cypress from VS IDE and Cypress was working while until I encountered the error below ...
Read more >Server-side rendering (SSR) - Inertia.js
SSR is not yet ready for the Svelte adapter. However, it's something we're actively working on adding. How it works. When Inertia detects...
Read more >How to Configure SSG and SSR on Nuxt.js - Mad Devs
Since nuxt has several modes of operation, not all plugins can be plugged directly into components. This is due to the fact that...
Read more >Node.js Server Side Rendering (SSR) using EJS
Server-side rendering (SSR) is a popular technique for rendering a normally client-side only single page app (SPA) on the server and then ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
hi @palerdot i’ve other solution for next.js, it works for me! Reference: https://nextjs.org/docs/advanced-features/dynamic-import#with-no-ssr
@warmansuganda Thank you. I will link this issue in the FAQ so that people can find the solution you suggested.
You can also raise a PR for this if you are interested.