Support ESM
See original GitHub issueThe support with ES6 module is not provided.
Description
When we define type: “module” and define our new relic config as newrelic.cjs. The file is not found as the default file named to include the named as a constant const DEFAULT_FILENAME = 'newrelic.js'
and hence the cjs file is not included.
Expected Behavior
The newrelic.cjs file should be considered for importing.
Steps to Reproduce
- Create New Express project.
- Add type: “module” in package.json
- Create file newrelic.cjs (require will not work in modules. we have to use import).
- Import ‘newrelic’ in the start file.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:55
- Comments:30 (14 by maintainers)
Top Results From Across the Web
What does it take to support Node.js ESM? – The Guild
I have worked on all The Guild's libraries and graphql-js to support ESM. Here is how you can do it too.
Read more >Getting Started with (and Surviving) Node.js ESM
The Node.js ecosystem is shifting towards ESM. We examine what lies in store for application and library authors, learn some of challenges ...
Read more >ECMAScript modules | Node.js v19.3.0 Documentation
Node.js fully supports ECMAScript modules as they are currently specified and ... Caveat: The ESM load hook and namespaced exports from CommonJS modules...
Read more >"ESM" | Can I use... Support tables for HTML5, CSS3, etc
"Can I use" provides up-to-date browser support tables for support of front-end web technologies on desktop and mobile web browsers.
Read more >supports-esm - npm
Detect at runtime if Node.js supports ECMAScript modules. ... Start using supports-esm in your project by running `npm i supports-esm`.
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
I didn’t know people were still using common js. Most examples for libraries and services are all esm. Your competitors have been supporting this for a long time. https://docs.datadoghq.com/tracing/setup_overview/setup/nodejs/?tab=containers
I think our wires got crossed internally around flipping the switch on making it public. Either way be on the look out for 9.1.0 release of agent with support for ESM.