New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BABEL_PARSER_SYNTAX_ERROR error with 2.3.1 when using d3 #11525
Comments
Is it the same as before or is it coming from a new package? Sadly the output here isn't of much help. |
Probably again this: |
This issue tracks it in Babel: |
I saw the babel issue but looks like no one has done anything in 6 months. The thing I am trying to tack down is why any version prior 20 meteor 2.2.1 works As stated this is just the example code with d3 added in. No new package and the output is all babel gives me. |
Any of my projects with d3 gets the same error. If someone is using d3 with meteor 2.2.1 or greater and it is working would like to know. |
🤔 I think that it could be either babel/typescript updates or maybe one of the babel related dependencies. We should probably try to play with those for now. |
Downgrading to d3 v5 removes the error when using meteor 2.2.1 -2.3.1 Downgrading meteor to 2.2 removes the error when using d3 vs 7 Commenting out the lines in the
Since the babel npm version is the same in all the above combinations I think it is how the newer versions of meteor are handing the code to babel??? |
I hit upon a very similar error with @amcharts/maps. Downgrading to 2.2 seems to solve the issue for now. |
Unfortunately, that affects any library that is using D3 under the hood. We’re using react-globe-gl and fell into the same trap when upgrading Meteor to 2.2.1. We didn’t want to upgrade to the latest Meteor because of potential breaking changes caused by Node 14. |
Looks like they have made another go at fixing this: babel/babel#13581 |
I'm guessing it will be in Babel 7.14.9. I will update all the packages when it comes out. |
Thanks. Any chance to get this down ported to 2.2.1? I’m hesitating to upgrade to Node 14. |
@derwaldgeist I'll look into it once the fix comes out. |
Babel 7.14.9 is out with the fix. |
I have updated babel for 2.3.3 both in the bundle and in skeletons. I'm going to the new version now to see if it resolves the issue. |
Hi, at least for me it does not solve the issue. It seems that the meteor babel-compiler package uses @meteorjs/babel wrapper with @babel/parser@7.14.3 |
@larswolter Good catch! I will update that one asap! |
Even with all of that I'm still getting the error in |
I upgrade my test app of this (modified simple-tofod-blaze with d3 added) and I am still getting the error about the cumsum.js file but it is a little nicer error output. This was even after removing and reinstalling all the NPMs.
|
For me it also fails with the new ersion but without the nice error output. I tried to verify if the new @babel/parser fixes the problem and it does not. The error only occurs when using the babel/parser flow plugin, following is a small example to test it import babelParser from '@babel/parser';
import fs from 'fs';
// meteor default (from Meteor babel-compiler Babel.getDefaultOptions()))
//const options = { "allowImportExportEverywhere": true, "allowReturnOutsideFunction": true, "allowUndeclaredExports": true, "plugins": ["*", "flow", "jsx", "asyncGenerators", "bigInt", "classPrivateMethods", "classPrivateProperties", "classProperties", "doExpressions", "dynamicImport", "exportDefaultFrom", "exportExtensions", "exportNamespaceFrom", "functionBind", "functionSent", "importMeta", "nullishCoalescingOperator", "numericSeparator", "objectRestSpread", "optionalCatchBinding", "optionalChaining", ["pipelineOperator", { "proposal": "minimal" }], "throwExpressions"], "sourceType": "module", "strictMode": false }
// meteor default (from Meteor babel-compiler Babel.getDefaultOptions())) without flow
//const options = { "allowImportExportEverywhere": true, "allowReturnOutsideFunction": true, "allowUndeclaredExports": true, "plugins": ["*", "jsx", "asyncGenerators", "bigInt", "classPrivateMethods", "classPrivateProperties", "classProperties", "doExpressions", "dynamicImport", "exportDefaultFrom", "exportExtensions", "exportNamespaceFrom", "functionBind", "functionSent", "importMeta", "nullishCoalescingOperator", "numericSeparator", "objectRestSpread", "optionalCatchBinding", "optionalChaining", ["pipelineOperator", { "proposal": "minimal" }], "throwExpressions"], "sourceType": "module", "strictMode": false }
// minimum failing
const options = { sourceType: 'module', plugins: ['flow'] };
const res = babelParser.parse(
fs.readFileSync('./node_modules/d3-array/src/cumsum.js').toString(),
options);
console.log(`Successfully parsed src`); Using the following package.json {
"name": "parsercheck",
"version": "1.0.0",
"description": "test for d3-array compiling failure",
"main": "index.js",
"type": "module",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Lars Wolter",
"license": "ISC",
"dependencies": {
"@babel/parser": "^7.14.9",
"d3-array": "^3.0.1"
}
} |
The according issue in Babel babel/babel#13644 |
PR to fix this: babel/babel#13655 |
@nicolo-ribaudo thanks for finding the new PR. I'll be watching it and update dependencies accordingly once it is merged. |
Grettings @StorytellerCZ! Great that the fix is coming! 😄 We have faced this issue on a large app that uses d3 as well. Anyway, is there a way to force |
If you are using Yarn, you can add this to your "resolutions": {
"@babel/parser": "1.2.3"
} where |
@nicolo-ribaudo Thank you! I used this on the past and worked well. However, I think the issue mentioned in this thread is related with meteor infrastructure to bundle and the usage of So my question is more around how we can relace on-fly the definitions of these libraries on Meteor level if possible. I don't think we have a way to use NPM resolutions straight on Meteor core since NPM packages are described behind the definitions of athmosphere packages and these don't support resolutions. I can only think on use a custom Meteor, and fork all libraries using Anyway, I will wait for the next patch version when ready. 😄 |
It is as @Gywem says. I'm watching babel daily to for new versions and will update them for each beta until we get the fix. |
@nicolo-ribaudo I will make a new 2.4 beta with the new version straight away. |
@StorytellerCZ: Can we get a patch on 2.3.x? Or should we upgrade straight to 2.4? |
@Gywem we'll test on 2.4 beta and then I'll look into backporting it to 2.3. There will be a new version anyhow today or tomorrow due to Node security release. |
Any chance to downport to 2.2.1 as well? We're still on this version, since 2.3 brought a new major Node release. |
@derwaldgeist since Node 12.x is also getting a security release I will release 2.2.3 which will include these fixes as well, but 2.3.5 will have priority. |
Awesome, thanks! |
2.3.5-beta.0 solved it for me. Thanks for the quick fix and backporting! |
Getting BABEL_PARSER_SYNTAX_ERROR when starting up meteor on 2.2.1, 2.3 or 2.3.1. Report here is for 2.3.1
Reported here #11410 but it is a pull not a bug:
Steps to reproduce:
meteor create --blaze simple-todos-blaze
meteor update --release 2.3.1
meteor npm install --save d3
meteor
Result:
Remove d3 and it is fine.
Versions:
"@babel/runtime": "^7.11.2",
"d3": "^7.0.0",
"jquery": "^3.5.1",
"meteor-node-stubs": "^1.0.1"
Issue still exists after updating npms:
"@babel/runtime": "^7.14.6",
"d3": "^7.0.0",
"jquery": "^3.6.0",
"meteor-node-stubs": "^1.0.3"
This is not an issue on Meteor 2.2!
The text was updated successfully, but these errors were encountered: