export-namespace-from is not respected
See original GitHub issueDescribe the bug
Seems like export-namespace-from
is not respected when used with Next.js
/sandbox/node_modules/react-dnd/dist/esm/index.js:1
export * from './common';
^^^^^^
SyntaxError: Unexpected token export
at Module._compile (internal/modules/cjs/loader.js:721:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.react-dnd (/sandbox/.next/server/static/development/pages/index.js:1298:18)
at __webpack_require__ (/sandbox/.next/server/static/development/pages/index.js:23:31)
at Module../pages/index.js (/sandbox/.next/server/static/development/pages/index.js:1087:67)
at __webpack_require__ (/sandbox/.next/server/static/development/pages/index.js:23:31)
at Object.3 (/sandbox/.next/server/static/development/pages/index.js:1132:18)
at __webpack_require__ (/sandbox/.next/server/static/development/pages/index.js:23:31)
at /sandbox/.next/server/static/development/pages/index.js:91:18
at Object.<anonymous> (/sandbox/.next/server/static/development/pages/index.js:94:10)
at Module._compile (internal/modules/cjs/loader.js:776:30)
Reproduction
Steps to reproduce the behavior:
- start any project with Next.js
- install
react-dnd
- run the
yarn dev
Expected behavior It should get complied
Although, the same works with CRA, demo here
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:5
Top Results From Across the Web
export-namespace-from is not respected · Issue #8404 - GitHub
Describe the bug Seems like export-namespace-from is not respected when used with Next.js ...
Read more >Export namespace should be first transformed by `@babel ...
I get the following error when I want to build my APK. Export namespace should be first transformed by @babel/plugin-proposal-export-namespace- ...
Read more >@babel/plugin-proposal-export-namespace-from | Yarn - Yarn
Fast, reliable, and secure dependency management.
Read more >babel/plugin-proposal-export-namespace-from
NOTE**: This plugin is included in `@babel/preset-env`, in [ES2020](https://github.com/tc39/proposals/blob/master/finished-proposals.md)
Read more >npms.io search
@babel/plugin-proposal-export-namespace-from(7.12.13) ... Offers getProxyForUrl to get the proxy URL for a URL, respecting the *_PROXY (e.g. HTTP_PROXY) and ...
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 FreeTop 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
Top GitHub Comments
when I npm install will get the error “”
===============
the version of react-dnd is 9.3.x; when
npm install react-dnd
&npm install react-dnd-html5-backend
will get the error is "Unexpected token export "; ===============||you can do this||========= =>npm uninstall react-dnd
&npm uninstall react-dnd-html5-backend
=>npm install react-dnd-cjs
npm install react-dnd-html5-backend-cjs
=> and change the import :will be ok; thks
@kuldeepkeshwar, @miguelpel I had the same issue and maybe this can help you Similar discussion about module transpiling: https://spectrum.chat/next-js/general/have-no-idea-how-to-combine-amchart-with-next-js~37b6a631-663c-4a3c-94a0-568991f275de the package itself: https://www.npmjs.com/package/next-transpile-modules
But what described above hadn’t helped me, so I did how described here and it worked https://github.com/react-dnd/react-dnd/issues/1414 and use these libraries: https://www.npmjs.com/package/react-dnd-html5-backend-cjs https://www.npmjs.com/package/react-dnd-cjs