Skip to content

bug: invalid import paths in app.js introduced with v4.19.0 #5882

@christian-bromann

Description

@christian-bromann

Prerequisites

Stencil Version

v4.19.0

Current Behavior

Starting this version I see the following imports in my app.js which don't resolve:

import { bootstrapLazy } from '../node_modules/@stencil/core/internal/client/index.js?app-data=conditional';
export { setNonce } from '../node_modules/@stencil/core/internal/client/index.js?app-data=conditional';
import { patchBrowser } from '../node_modules/@stencil/core/internal/client/patch-browser.js';
import { g as globalScripts } from './app-globals-6b09102a.js';

Expected Behavior

In v4.18.x the same compile step results in the following output:

import{p as o,b as t}from"./p-2b58b695.js";export{s as setNonce}from"./p-2b58b695.js";import{g as r}from"./p-fc662416.js";var p=()=>{const t=import.meta.url;const s={};if(t!==""){s.resourcesUrl=new URL(".",t).href}return o(s)};p().then((async o=>{await r();return t([["p-51f58157",[[1,"app-root",{count:[2],docsHint:[1,"docs-hint"]}]]]],o)}));
//# sourceMappingURL=app.esm.js.map

So there are two observations:

  • the imports became invalid
  • the code isn't minified

System Info

System: node 20.12.2
    Platform: darwin (22.6.0)
   CPU Model: Apple M2 Max (12 cpus)
    Compiler: /Users/christian.bromann/Sites/WebdriverIO/projects/electron-boilerplate/node_modules/@stencil/core/compiler/stencil.js
       Build: 1716921701
     Stencil: 4.18.3 😄
  TypeScript: 5.4.5
      Rollup: 2.56.3
      Parse5: 7.1.2
      jQuery: 4.0.0-pre
      Terser: 5.31.0

Steps to Reproduce

Run the following:

git clone git@github.com:webdriverio/electron-boilerplate.git
cd electron-boilerplate
npm i
npm run build

observe the output in dist. Then update the Stencil version to v4.18.3 and rebuild the project.

Code Reproduction URL

https://github.com/webdriverio/electron-boilerplate

Additional Information

No response

Metadata

Metadata

Labels

Bug: ValidatedThis PR or Issue is verified to be a bug within Stencil

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions