stencil icon indicating copy to clipboard operation
stencil copied to clipboard

Bundling warning SOURCEMAP_ERROR

Open dgonzalezr opened this issue 3 years ago • 6 comments

Prerequisites

Stencil Version

2.11.0

Current Behavior

When enabling source maps on stencil.config.ts a warning message is shown during the build:

CleanShot 2021-12-01 at 20 09 40

Expected Behavior

Source maps get built without issues.

Steps to Reproduce

  1. Setup a stencil component project.
  2. Enable source maps on stencil.config.ts: sourceMap: true.
  3. Build the project with npm run build.

Code Reproduction URL

https://github.com/dgonzalezr/stencil-tailwind

Additional Information

No response

dgonzalezr avatar Dec 01 '21 18:12 dgonzalezr

Looks like this was introduced in v2.10.0, but is not present in v2.9.0. We'll take a further look!

rwaskiewicz avatar Dec 01 '21 18:12 rwaskiewicz

Any update about this issue? It is still happening with the latest @stencil/core version 😐

dgonzalezr avatar Jan 29 '22 13:01 dgonzalezr

I did some preliminary digging on this issue. It appears to:

  • occur in v2.9.0 (which is the opposite of what I mentioned here)
  • manifest only when more than one output target is used (e.g. www and dist-custom-elements)

This leads me to believe that rollup is either reading a file that's not in a 'good state' (because it's being modified by another output target) or something similar. I don't have a definitive timeline for when we'll be able to fix this, but I promise it hasn't been forgotten about 🙂

rwaskiewicz avatar Jan 31 '22 13:01 rwaskiewicz

is there any workaround for this issue?

pratheeshp007 avatar May 06 '22 17:05 pratheeshp007

@dgonzalezr @pratheeshp007 This seems to have been fixed in 2.18.0. I update jeep-sqlite this morning with 2.18.0 and the warning message disappears.

jepiqueau avatar Sep 19 '22 10:09 jepiqueau

@dgonzalezr @pratheeshp007 @rwaskiewicz Well in fact after having done a npm start when you do a npm run build the warning message is still there

jepiqueau avatar Sep 19 '22 12:09 jepiqueau

Hello there, I had the issue for a while and indeed, I'm using multiple output targets (stencil 2.18.0)

Fixed the issue by removing the dist-hydrate-script output (https://stenciljs.com/docs/hydrate-app#how-to-use-the-hydrate-app)

I don't use it, it was it was a simple experimentation :)

KevinCarnaille2 avatar Sep 28 '22 09:09 KevinCarnaille2

Don't know if it can help, my 2 cents :

I got the warning as soon as I include the dist-custom-element in outputTarget. I have no warning if I remove dist-hydrate-script as well. Currently I work with this config :

outputTargets: [
{
    type: 'dist-hydrate-script',
},
{
    type: 'dist',
    dir: './dist',
    copy: [
        { src: 'fonts', dest: './fonts' }
    ]
},
{
    type: 'dist-custom-elements',
    dir: './dist/components'
},
{
    type: 'www',
    empty: false, // to prevent playground compiled css (by sass CLI) to be overriden
    serviceWorker: null, // disable service workers,
    copy: [
        { src: 'fonts', dest: './build/fonts' }
    ]
},
{
    type: 'stats',
    file: './dist/stats.json',
},
{
    type: 'docs-vscode',
    file: './dist/vscode-data.json',
},

KevinCarnaille2 avatar Nov 03 '22 14:11 KevinCarnaille2

Looks like this was introduced in v2.10.0, but is not present in v2.9.0. We'll take a further look!

Is still present in Stencil 3.1.0

Is there a roadmap on when this will be fixed?

iraklisg avatar Mar 09 '23 11:03 iraklisg

A dev build of Stencil, 3.2.0-dev.1679942506.7994efe has been published to npm to fix this issue. Feedback from anyone who can install and test this build out would be much appreciated!

npm install @stencil/[email protected]

rwaskiewicz avatar Mar 27 '23 18:03 rwaskiewicz

The fix for this issue has been released in Stencil v3.2.1 this afternoon. As a result, I'm going to close this issue. Should it reappear, please feel free to open a new ticket. Thanks!

rwaskiewicz avatar Apr 10 '23 18:04 rwaskiewicz

@rwaskiewicz Unfortunately after updating @stencil/core the issue still remains on my side.

CleanShot 2023-04-11 at 19 59 54

You can check the specific branch of this PR: https://github.com/Endava/bee-q/pull/145

Now, is true that I have multiple outputs configured on my stencil.config.js, so I wonder if the root cause could be another output different from dist-custom-elements.

dgonzalezr avatar Apr 11 '23 17:04 dgonzalezr

@dgonzalezr I suspect there may be a similar bug to the one that was fixed related to the dist-hydrate-script output target. Can you do me a favor and comment out the following in your project's stencil.config.ts and let me know if you still see the error?

    {
      type: 'dist-hydrate-script',
      dir: 'dist/hydrate',
    },

rwaskiewicz avatar Apr 11 '23 17:04 rwaskiewicz

@rwaskiewicz thank you for your reply. I can confirm that removing dist-hydrate-script makes the error to disappear 🙂

CleanShot 2023-04-12 at 20 10 01

dgonzalezr avatar Apr 12 '23 17:04 dgonzalezr

@dgonzalezr Thanks! I'm going to create a new issue here in GitHub to capture the issue with `dist-hydrate-script'

rwaskiewicz avatar Apr 12 '23 17:04 rwaskiewicz

https://github.com/ionic-team/stencil/issues/4260 created

rwaskiewicz avatar Apr 12 '23 18:04 rwaskiewicz

@rwaskiewicz thank you for your reply. I can confirm that removing dist-hydrate-script makes the error to disappear slightly_smiling_face

...

The same bug can be observed if we set externalRuntime: false for this output target. Screenshot from 2023-05-16 17-50-30

shtolcers avatar May 16 '23 14:05 shtolcers

For anyone running into this issue with dist-custom-elements and dist-hydrate-script set, please see https://github.com/ionic-team/stencil/issues/4260#issuecomment-1613190360

rwaskiewicz avatar Jun 29 '23 13:06 rwaskiewicz

@shtolcers If you get a moment, can you please try

npm i @stencil/[email protected]

and help me confirm that fixes the issue?

rwaskiewicz avatar Jun 29 '23 18:06 rwaskiewicz

Hi @rwaskiewicz I still have the warning in 3.3.0, but I've tried the 4.0.1-dev.1688059870.bea1aeb and it's fixed !

KevinCarnaille2 avatar Jun 30 '23 07:06 KevinCarnaille2

Hello @rwaskiewicz my apologies for the late response here.

I can confirm that the issue is fixed within the 4.0.1-dev.1688059870.bea1aeb version

image

CleanShot 2023-07-05 at 19 31 07

Thank you so much 🙌🏼

dgonzalezr avatar Jul 05 '23 16:07 dgonzalezr