GithubHelp home page GithubHelp logo

Comments (7)

jdalton avatar jdalton commented on May 16, 2024 1

Patched (62c4328 and bc9642a)!

Thanks for digging in!

from babel-plugin-lodash.

jdalton avatar jdalton commented on May 16, 2024

I can't repro this. If you don't have lodash installed then it should error with

Error: Cannot find module 'lodash'

with lodash installed the output I get is:

'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _crypto = require('crypto');

Object.defineProperty(exports, 'theCryptoModule', {
  enumerable: true,
  get: function () {
    return _interopRequireDefault(_crypto).default;
  }
});

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

from babel-plugin-lodash.

not-an-aardvark avatar not-an-aardvark commented on May 16, 2024

Thanks for looking into it, but that's confusing because it's definitely occurring for me (for one reason or another).

I made a repo to demonstrate it -- are you able to reproduce it with that?

from babel-plugin-lodash.

jdalton avatar jdalton commented on May 16, 2024

It's something with your npm-shrinkwrap. If I delete that then I get a different error related to not having lodash installed. It's not the proper error, so a bug on the plugin (patched ee8002f), but I don't believe it's related to the transform.

from babel-plugin-lodash.

not-an-aardvark avatar not-an-aardvark commented on May 16, 2024

It looks like there's a preinstall script that's getting run from somewhere, which might be causing the issue:

> [email protected] install /path/to/babel-plugin-lodash-bug-demo/node_modules/fsevents
> node-pre-gyp install --fallback-to-build

  SOLINK_MODULE(target) Release/.node
  CXX(target) Release/obj.target/fse/fsevents.o
  SOLINK_MODULE(target) Release/fse.node
  COPY /path/to/babel-plugin-lodash-bug-demo/node_modules/fsevents/lib/binding/Release/node-v48-darwin-x64/fse.node
  TOUCH Release/obj.target/action_after_build.stamp

I was able to toggle the bug by doing this:

$ rm npm-shrinkwrap.json
$ rm -rf node_modules/
$
$ npm config set ignore-scripts true
$ npm install && npm test # no error
$ rm -rf node_modules/
$
$ npm config set ignore-scripts false
$ npm install && npm test # error!

from babel-plugin-lodash.

not-an-aardvark avatar not-an-aardvark commented on May 16, 2024

I'm trying to find where this issue is coming from, but I can't seem to figure out why you're not able to reproduce it. The shrinkwrap file in the repo was generated by simply running npm install followed by npm shrinkwrap.

I tried running the demo on a travis server, and a SyntaxError appeared regardless of whether a shrinkwrap was present. (Here's the build with the shrinkwrap, and here's the build without a shrinkwrap -- both of them confirm this bug.)

from babel-plugin-lodash.

not-an-aardvark avatar not-an-aardvark commented on May 16, 2024

Thanks!

from babel-plugin-lodash.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.