Skip to content

bug: Nuxt build error with SSR capability #631

Open
@mamillastre

Description

@mamillastre

Prerequisites

Stencil Version

4.27.2

Stencil Framework Output Target

Vue

Stencil Framework Output Target Version

0.9.6

Current Behavior

The Nuxt (3.16.0) application build failed with this error:

[ nuxi  2:34:51 PM]  ERROR  Nuxt Build Error: ../../packages/core/hydrate/index.mjs (2:0): "Readable" is not exported by "__vite-browser-external", imported by "../../packages/core/hydrate/index.mjs".
file: ../../packages/core/hydrate/index.mjs:2:0

1: import { Readable } from 'stream';
2: 
   ^
3: const modeResolutionChain = [];

Expected Behavior

Build success.

Steps to Reproduce

I fork the designsystem-boilerplaterepo to reproduce the bug:

  • Clone the below "Code reproduction URL"
  • In the root of the project:
  • npm i -ws
  • npm run build:nuxt

Code Reproduction URL

https://github.com/mamillastre/stencil-code-reproduction

Additional Information

In the vue package, Stencil will generate the component.ts file that lazy load the @placeid/code/hydrate that uses the streamdependency.
But this dependency has to be used in a node context and I thick we have this error because Nuxt try to compile in a browser context.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wanteda good issue for the communitytype: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions