Comments (7)
Patched (62c4328 and bc9642a)!
Thanks for digging in!
from babel-plugin-lodash.
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.
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.
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.
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.
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.
Thanks!
from babel-plugin-lodash.
Related Issues (20)
- Babel 7 support HOT 2
- Issues while using with Babel 7 and Typescript plugin HOT 4
- Error: Couldn't find preset "@babel/env" relative to directory HOT 1
- Bundle size not reduced when I make a production build HOT 1
- Lazy evaluation not working for fp.flow HOT 2
- cccccckiekunkdevvibtrjecnjlngvkhvhdvdbkgcgbg
- 'unionBy' do not accept property name as iteratee HOT 3
- Plugin adds weight to project HOT 3
- Lodash is set to undefined in build if its loaded onto a local 'this' HOT 4
- Bundle contains many lodash functions HOT 5
- tips
- The 'react-router-dom' method `useLocation` is not a known module.
- lodash.min.js is not removed from the bundle HOT 2
- Do you have plan to support vitejs? HOT 1
- Import with extensions
- lodash and pnpm
- Is this plugin still relevant? HOT 4
- Error: "Cannot read property 'has' of undefined" after glob update v7.2.0 to v7.2.2
- use `module:`
- `isModuleDeclaration` has been deprecated HOT 14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from babel-plugin-lodash.