Open OuranosSkia opened 8 months ago
Thanks! I've verified something isn't right here and have ingested it into our internal backlog for someone to take a closer look
Circling back on this, the newrelic team also did a little investigating and believe this issue is likely related to #3605. Do you know if there is an ETA on when that feature request will be implemented?
That issue is going to require a major version release of Stencil, due to breaking changes in the rollup library that may affect Stencil users. I don't have an exact timeline, other than sometime later year.
Makes sense. In the meantime, the newrelic team found a temporary workaround in case others run into this issue. Changing the import from @newrelic/browser-agent/...
to @newrelic/browser-agent/src/...
allows Stencil to properly find and rollup the dependency (though I understand it's not a good best practice to import the src
directory of a module)
Coming back to this after some time, is it still on the agenda? There is a vaild use case for newrelic micro-agents in combination with microfrontends based on stencil. I can confirm the workaround to import from src
works in our application, but it leads to more workarounds, e.g. compilation errors while running tests and it can also negatively effect bundle sizes.
Prerequisites
Stencil Version
4.7.0
Current Behavior
When importing the
@newrelic/browser-agent
module to a Stencil project, the bundler does not seem to know how to bundle newrelic. I get an UNRESOLVED_IMPORT message. Other imports to stencil appear to work properly and only newrelic's browser agent seems to have an issue.Expected Behavior
The project builds properly with the newrelic import and, when started, properly tries to load the newrelic agent (it's not configured in this example, but I should see it try).
System Info
Steps to Reproduce
(Attached a code sample or just create a new Stencil project following the Getting Started docs for it and import the browser agent) test-newrelic.zip
After unzipping the code sample, run:
yarn
(ornpm i
) to install dependenciesyarn build
or (npm run build
) to build the app.When building, you will see:
Additionally, you can start the app with
yarn start
ornpm start
. If you start it and load the URL of the page, you will see:Code Reproduction URL
https://github.com/OuranosSkia/test-newrelic
Additional Information
No response