Closed DavidBruant closed 6 years ago
I apologize for the vague "When a project is big enough". As can be seen in #53, it works with small projects, but not for bigger ones. But I haven't found the threshold that triggers the bug (whether it's in number of files, dependency depth or file size or something else)
Error: Could not load uuid (imported by /home/david/projects/dataviz-finances-gironde/client/js/objectId.js): ENOENT: no such file or directory, open 'uuid' while parsing file: /home/david/projects/dataviz-finances-gironde/client/js/main.js
Needless to say, the module didn't magically disappear, it's still around. Also, the dependency that "could not be loaded" can change (not always uuid on my project), but I haven't found the criterion leading to a given module not being "ENOENT"-ed. It might be a race condition.
I'm having a very similar issue as this, it's seemingly random when running a manual build but always happens if the build is triggered by a watch. browserify -> rollupify -> babelify -> envify
running in a gulp task seems to trip over itself resulting in an error.
My Environment: OS: Win32 Node: 6.10.2 npm: 3.10.10 Gulp: 3.9.1
Related Modules: babelify ^7.3.0 browserify ^14.3.0 envify ^4.0.0 rollup-plugin-commonjs ^8.0.2 rollup-plugin-node-resolve-auto ^1.0.1 rollupify ^0.3.9
Example of my test runner task:
let cache;
gulp.task('js', ['js:lint'], () => {
return gulp.src(['src/*.js'], { read: false })
.pipe(plumber({ errorHandler: utility.errorHandler }))
.pipe(tap((file) => {
file.contents = browserify(file.path, {
debug: true
})
.transform('rollupify', {
cache: cache,
plugins: [nodeResolve, rollCommon]
})
.transform('babelify', {
presets: ['es2015']
})
.transform('envify', {
PROJECT_VAR: process.env.PROJECT_VAR
})
.on('bundle', (buf) => {
cache = buf;
})
.bundle()
.on('error', (err) => {
utility.errorHandler(err, this);
this.emit('end');
});
}))
.pipe(buffer())
.pipe(uglify())
.pipe(gulp.dest('dest/');
});
Resulting Error:
Error: Could not load <dependency_path>.js (imported by D:\<project_dir>\<file_name>.js):
ENOENT: no such file or directory, open 'D:\<project_dir>\<dependency_path>' while parsing file: D:\<project_dir>\<another_file_name>.js
(node:11192) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read property 'emit' of undefined
This seems to happen on projects with a greater amount of node dependencies, I created a small test case with no external dependencies and so far can't reproduce the error there.
Could this be a file locking problem?
I think this is related to https://github.com/rollup/rollup/issues/982
closing stale issues, apparently fixed in rollup 0.50.0
I'm having the problem in this repo https://github.com/dtc-innovation/dataviz-finances-gironde Install with after clone
I get the following output :
Works fine the first time.
When I edit
main.js
, the output is as follow:From various testing (including what I did for #53 ), it looks like rollupify is the changing factor that leads to this problem.
I'm on Ubuntu, @oncletom is on OSX but has met the same problem.