Skip to content

bug: import statements from dist-custom-elements getting passed to commonjs and errors in SSR Applications like NextJS. #3176

@roman-telia

Description

@roman-telia

Prerequisites

Stencil Version

2.11.0

Current Behavior

after we updated from dist-custom-elements-bundle to dist-custom-elements we are running into issues with NextJS when using our commonjs react wrappers in NextJS app, when running next js or building it throws error that can't use import statement outside of a module.

Expected Behavior

It should work the same way as before with dist-custom-elements-bundle, that there wasn't imported es6 module files in commonjs react output.

Steps to Reproduce

create build output, install new package version in Next js project, try to run the next app after installing latest package and you will get this error.

Code Reproduction URL

https://github.com/roman-telia/Next-vocads-playground

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions