Open Sanshain opened 6 months ago
Thanks for looking into this. What's the story with the source-map-fast
? Is there some sort of issue with the dependency? Is there a scenario that reproduces the bug you faced with it?
Thanks for looking into this. What's the story with the
source-map-fast
? Is there some sort of issue with the dependency? Is there a scenario that reproduces the bug you faced with it?
Hello! I faced with a trouble in an attempt to get to work together nollup
and linaria
(@linaria/rollup
package via --force
flag). It looked like this:
The trouble was - as I figured out - in 255 line of lib/util.js
file inside source-map
package:
The aRoot
variable is undefined, but it used as if it exact string type! I've notived that developers of the sourcemap
package don't use typescript and even jsdoc at all. So types lack makes very easy possibility to make a mistakes.
To avoid the problem I have forked nollup repository and tried to update source-map
dependency. But despite plural updates implemented by source-map
developers - it still had the problem. But now the trouble was moved into getURLType
function:
function getURLType(url) {
if (url[0] === "/") {
if (url[1] === "/") return "scheme-relative";
return "path-absolute";
}
return ABSOLUTE_SCHEME.test(url) ? "absolute" : "path-relative";
}
Above, the argument url
may be undefined. Therefore it also leads to the same problem (but now it is attempt to get index on undefined).
I sent pull request three months ago, but it seems the problem still exists.
By the way I tried the same configuration with rollup and the error didn't throw - I don't aware why so.
But nevertheless, I am inclined to that the problem is not problem of nollup. I think it is a problem of source-map
. However I needed to fix this trouble at moment,. So I solved it via fixed fork of the source-map
(may be there is a better approach to solve this one, but I didn't guess it).
And I don't know if this will be useful for nollup as a project, but at least you will be aware that cases like this are possible.
This fix I implemented with a goal of compatibility with latest versions of @rollup/plugin-node-resolve
package (it works well for me)
Thank you for your project. You did a great job. I hope it will be alive, despite other popular projects.
That's a widespread problem with compability nollup and actual versions of official rollup plugin (@rollup/plugin-node-resolve, @rollup/plugin-commonjs etc), for example with node-resolve v 15.2.3:
Most of them require at least 2.78.0 rollup version. I figered out that to solve this problem, it is quite to update version
rollupVersion
withinlib/impl/PluginMeta.js
file. After the fix nollup continues to interact perfectly with the newest at the moment versions of the plugins