Bug introduced in 12.0.1 (Breakage with symlink + Babelify)
See original GitHub issueOverview
The single line (excluding tests) changed in patch release 12.0.1 causes breakage in applications using symlinks and Babelify.
(I discovered this today, as the latest release of grunt-browserify upgrades Browserify from v11 to v13.)
Specifics
I have a project which uses symlinks in accordance with the Browserify Handbook, arranged as follows:
node_modules/
├── ...
└── appName -- symlink to 'src/' directory
src/
├── ...
└── main.js
...
.babelrc -- where Babelify looks for its parameters
...
I then simply execute (the Grunt equivalent of):
browserify src/main.js -o build/app-name.js -s AppName -t babelify
This works perfectly through Browserify 12.0.0, but as of 12.0.1 and beyond, I see the error:
ParseError: 'import' and 'export' may appear only with 'sourceType: module'
This error does not occur (and the build succeeds) if I don’t use the symlink in my import
s.
As implied above, everything works as it used to if I simply revert the offending line in index.js:
cb(err, res, pkg, file);
→ cb(err, res, pkg);
Issue Analytics
- State:
- Created 8 years ago
- Reactions:8
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Compare Versions | @stackstorm/module-forms | npm | Open ...
@lerna/symlink-dependencies 3.13.0. @lerna/symlink-dependencies 3.13.0 ... @octokit/request-error 1.2.1 ... babelify 10.0.0. babelify 10.0.0. bach 1.2.0.
Read more >Releases | Frida • A world-class dynamic instrumentation toolkit
Observe and reprogram running programs on Windows, macOS, GNU/Linux, iOS, watchOS, tvOS, Android, FreeBSD, and QNX.
Read more >react-on-rails | Yarn - Package Manager
Fixes server rendering when using a CDN. Server rendering would try to fetch a file with the "asset_host". This change updates the webpacker_lite...
Read more >Collibra Platform OSS Attribution File.txt
... [MIT] - @octokit/request (5.6.3) [MIT] - @octokit/request-error (2.1.0) ... babel-runtime (6.26.0) [MIT] - babelify (10.0.0) [MIT] - babylon (6.18.0) ...
Read more >opennebula: Changelog - doxygen documentation | Fossies Dox
<a href="https://github.com/yargs/yargs/compare/v11.1.0...v12.0.0" >12.0.0</a> (2018-06-26) · Bug Fixes · Chores · Features · BREAKING CHANGES.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
After eventually discovering #993, it appears that this may never have been intended to work, in spite of what the documentation suggests. In fact, when someone was kind enough to propose an update to the documentation (substack/browserify-handbook#36, 15 months ago), he was simply ignored.
I have confirmed that adding a src/package.json solves the issue:
Perhaps not a satisfying solution, but a solution nonetheless.
Really, I’m just in disbelief at the total lack of attention and documentation that this problem has received.
Is anyone looking into this? Seems like a pretty simple fix for a pretty horrendous bug.