nollup: Source maps don't work in the worker?

Hi again! It might be a problem with my configuration but I can’t get source maps to work with a worker, neither FF nor Chrome.

git clone git@github.com:tutao/nollup-bug.git
cd nollup-bug
git switch source-map-error
npm i
node make
# open url printed to the console or  python -m SimpleHTTPServer 9001 and open localhost:9000/build/index.html

Screenshot from 2020-12-08 17-42-22

no matter which files are imported in worker part, none of them are visible under “nollup://” nor can be found.

Please excuse me if it’s my fault but so far it seemed that nollup ignores sourceMap value which I pass so I don’t think I have much control.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 33 (30 by maintainers)

Most upvoted comments

Not entirely sure how that’s happening as a result of this change. But usually those happen because the library has relative paths to a source map included in the library. Nollup doesn’t try to remove those comments. In the case of @urql/core, it has the following inside it:

//# sourceMappingURL=urql-core.mjs.map

I’m not sure how that would have worked before though. As far as I understand, other bundlers like Webpack would still show the same warning message. There’s a plugin for this in Webpack, I suppose something similar would be needed here: https://webpack.js.org/loaders/source-map-loader/

Like so:

		code += `\\n${ConvertSourceMap.fromObject(map).toComment()}\\n//# sourceURL=nollup-int://${filePath}`;

EDIT: remove double .js