RSC import/export issues with esm external packages
See original GitHub issueVerify canary release
- I verified that the issue exists in Next.js canary release
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 21.4.0: Mon Feb 21 20:36:53 PST 2022; root:xnu-8020.101.4~2/RELEASE_ARM64_T8101
Binaries:
Node: 16.14.0
npm: 8.3.1
Yarn: 1.22.17
pnpm: 6.30.1
Relevant packages:
next: 12.1.2-canary.0
react: 18.0.0-rc.3
react-dom: 18.0.0-rc.3
What browser are you using? (if relevant)
Chrome 99.0.4844.84
How are you deploying your application? (if relevant)
Vercel
Describe the Bug
I upgraded from 12.1.1-canary.18
to 12.1.2-canary.0
and my Next.js app crashed:
After investigating, it seems that this syntax now causes a crash. I also verified that this is the syntax that’s used in the actual unicode-emoji
package published to npm (it’s not transpiled).
Expected Behavior
I’d expect the syntax mentioned above to work, just like it did with 12.1.1-canary.18
.
To Reproduce
- Install the
unicode-emoji
package (or any other one with this syntax). - Import and call the exported function (in the case of the mentioned package, that would be
getEmojisGroupedBy
).
I’m not sure if that’s relevant, but the import
is located in a client component (I’m using RSC).
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:7 (4 by maintainers)
Top Results From Across the Web
How Importing and Exporting Impacts the Economy
A rising level of imports and a growing trade deficit can have a negative effect on a country's exchange rate. A weaker domestic...
Read more >Acronyms Abbreviations &Terms - FEMA
Air Transportable RADIAC Package ... 1) Correspondence and Issues Management ... Department of Foreign Affairs and International. Trade.
Read more >DHS Acronyms, Abbreviations, and Terms (DAAT) List
ATRAP, Air Transportable RADIAC Package. | FEMA | ; ATS, Automated Targeting System. | CBP | PLCY | PRIV | ; ATSA, Aviation...
Read more >import "flask_sqlalchemy" could not be resolved ... - You.com
This article will give some solutions to fix the NameError: name 'false' is not defined […] Github Issues.
Read more >xdm - npm
TypeScript icon, indicating that this package has built-in type declarations. 3.4.0 • Public • Published 7 months ago.
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
@willemliufdmg Do you have a repro for that? what kind of files and next config break your case?I can repro it now, checking!I could create a minimal project using
npm init next-app -- --ts
. I’ve added some dependencies:When importing an SVG as a React component using react-svg-loader I get the following error:
This is the implementation of the component:
If I replace the icon with something else e.g. a text. The test will work as expected.
The implementation of the test:
This is next.config.js:
jest.setup.ts:
jest.config.js:
camera.svg: