jetstreamapp / soql-parser-js

Javascript SOQL parser
https://jetstreamapp.github.io/soql-parser-js/
MIT License
77 stars 20 forks source link

Failed to parse source map #227

Closed sylvainar closed 1 year ago

sylvainar commented 1 year ago

Description

Hi there!

I'm on the latest version of this package, it seems there is an issue with some sourcemaps that are triggering a bug while I compile the app, see screenshot included.

Screenshot_20230407_160744

paustint commented 1 year ago

I noticed the same issue, I am going to be pushing a version upgrade and will see if this self-corrects.

I didn't change anything, so don't know why this issue would have popped up in the first place.

paustint commented 1 year ago

This issue is resolved with version 4.8.1

maxence-lefebvre commented 1 year ago

Hello,

Unfortunately it isn't solved for the ESM build:

# We got this block for each file, not only utils.js
WARNING in ../../node_modules/soql-parser-js/dist_esm/utils.js
Module Warning (from ../../node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '<root>/node_modules/soql-parser-js/dist_esm/utils.js.map' file: Error: ENOENT: no such file or directory, open '/<root>/node_modules/soql-parser-js/dist_esm/utils.js.map'

Looking at the packaged sources, there is the //# sourceMappingURL=utils.js.map marker at the end of the file/dist_esm/utils.js but the .map file is still nowhere to be found for our bundler:

image

paustint commented 1 year ago

@maxence-lefebvre - Sorry about that, looks like there was a typo in the list of files to include in the npm package, so the esm sourcemaps were omitted.

A new version has been published to npm and sourcemaps are included.

image
maxence-lefebvre commented 1 year ago

Thank you so much for your reactivity @paustint :)

Unfortunately, the sourcemaps reference a src folder which is not packaged:

https://www.unpkg.com/soql-parser-js@4.8.2/dist_esm/utils.js.map

{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"..."}

image

paustint commented 1 year ago

Ugh, lame, sorry about that. I will take a look a bit later when I get some free time.

paustint commented 1 year ago

@maxence-lefebvre - Just published a new version, including all the typescript source files, so 🙏 everything should be there.

Let me know if you still have any build warnings/issues.

maxence-lefebvre commented 1 year ago

@paustint Thank you so much for your reactivity :pray:

Build warnings are finally gone! (except a last one from @chevrotain/utils)

Have a nice day!