Code Monkey home page Code Monkey logo

Comments (9)

xg-wang avatar xg-wang commented on July 16, 2024 1

Under repo https://github.com/buschtoens/ember-fetch-sourcemap-bug

rm yarn.lock
yarn install
ember b -prod

No more Building[WARN] (broccoli-uglify-sourcemap) "ember-fetch.map" referenced in "assets/vendor.js" could not be found

from ember-fetch.

buschtoens avatar buschtoens commented on July 16, 2024

The problem was introduced with v4.0.0.

While warning about deprecations, the source map gets built correctly:

yarn add -D 'ember-fetch@<4' && ember build -prod && head -c 500 ./dist/assets/vendor*.map

from ember-fetch.

buschtoens avatar buschtoens commented on July 16, 2024

Which is weird, because according to v3.4.4...v4.0.0 there is no difference between v3.4.5 and v4.0.0. 🤔

from ember-fetch.

buschtoens avatar buschtoens commented on July 16, 2024

Oops, it's not v3.4.4...v4.0.0. I was tired yesterday, sorry 😄. Looking for the right version now.

from ember-fetch.

buschtoens avatar buschtoens commented on July 16, 2024

It's v4.0.0...v4.0.1.

Works:

yarn add -D [email protected] && ember build -prod && head -c 500 ./dist/assets/vendor*.map

Breaks:

yarn add -D [email protected] && ember build -prod && head -c 500 ./dist/assets/vendor*.map

Therefore #112 (#111) bricked it. 🙁

from ember-fetch.

buschtoens avatar buschtoens commented on July 16, 2024

ember-fetch/index.js

Lines 128 to 130 in d25abf6

var polyfillTree = concat(new MergeTrees([find(expandedFetchPath), find(expandedAbortcontrollerPath)]), {
outputFile: 'ember-fetch.js'
});

broccoli-concat by default creates a source map and injects a sourceMappingURL comment into the file. When the file is eventually concatenated into vendor.js, something goes wrong and the sourceMappingURL is not processed and just stays as it is.

This means that later, when broccoli-uglify-sourcemap (L31) processes vendor.js, it finds the rogue sourceMappingURL comment and tries to load the ember-fetch.map, which of course at that point is not part of the tree anymore.

One possible fix is passing sourceMapConfig: { enabled: false } to broccoli-concat to disable source map generation and thus removing the sourceMappingURL comment.

from ember-fetch.

buschtoens avatar buschtoens commented on July 16, 2024

I guess the file ends up here and broccoli-concat itself is probably not aware of source maps when joining files.

So I guess passing sourceMapConfig: { enabled: false } is indeed the correct solution to this problem.

from ember-fetch.

xg-wang avatar xg-wang commented on July 16, 2024

@stefanpenner @tchak see comment here broccolijs/broccoli-concat#123 (comment)
Any thoughts about this?

from ember-fetch.

mhluska avatar mhluska commented on July 16, 2024

So the solution here was to nuke the yarn.lock file? 🤣

from ember-fetch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.