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.

[next] esm build not in dist

See original GitHub issue

Hi team,

I’m migrating from chart.js v2 to v3 and I’m looking forward to have good ESM and treeshaking support. I’ve been using this plugin so I tried the 2.0.0-rc.

It works but my the ESM file referenced in the package.json is not in my node_modules after installation.

This means my rollup configuration:

  • picks up the default CJS file in dist
  • which does a require('chart.js')
  • which imports the whole lib
  • and thus prevents treeshaking

I may be mistaken but I think the rollup config is in conflict here: https://github.com/chartjs/chartjs-plugin-datalabels/blob/next/rollup.config.js#L48

How can I help?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
hsablonnierecommented, May 20, 2021

You are awesome, thanks very much Simon 😍👍👏

1reaction
simonbrunelcommented, May 20, 2021

This is fixed by 0870ebe, released in v2.0.0-rc.1.

The ESM build is now correctly:

Read more comments on GitHub >

github_iconTop Results From Across the Web

Setting a custom build directory - next.config.js
Setting a custom build directory. You can specify a name to use for a custom build directory to use instead of .next ....
Read more >
Where Does Nextjs Put Build Folder? - Upmostly
Build. To build your NextJS project you need to run the build command. $ npm run build. in the root directory of your...
Read more >
How to generate build files in next js - Stack Overflow
I am learning basic next js. If we run npm run build create-react-app will generate build folder index.html and bundle files. In next...
Read more >
Understanding next build and the deployment process #14339
Hi all, I'm wondering if someone can help me "think in Next.js" around the process of build & deployment. My question is, I...
Read more >
Next.js build is failing - Render community
Error: Could not find a production build in the '/opt/render/project/src/.next' directory. Try building your app with 'next build' before ...
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