question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug introduced in 12.0.1 (Breakage with symlink + Babelify)

See original GitHub issue

Overview

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 imports.

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:open
  • Created 8 years ago
  • Reactions:8
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
rkirslingcommented, Apr 14, 2016

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:

{ "browserify": { "transform": ["babelify"] } }

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.

1reaction
BlueRajacommented, Apr 4, 2016

Is anyone looking into this? Seems like a pretty simple fix for a pretty horrendous bug.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found