Closed joerixaop closed 8 years ago
We really need something that we can run and reproduce to look into this
+1 I'm getting the same error with a little different setup. After the symlink stuff was merged in Browserify 10.2.6 I started receiving this error with symlinked .coffee files I'm requiring.
No +1s needed here please, only a clone-able example or a PR will help us address this.
Without a cloneable example we can't proceed
So I have a project with dependencies on jQuery (added via jquery-rails, and specified in my apps browserify-shim section), d3 and lodash. These last two come from npm, so their source is in the node_modules/ subdirectory
When I try to precompile assets on my local development machine (using all the same settings that are used in production) I get the expected output, with lodash and d3 added in the final output. When I run the same command with the same settings on I get the error:
Unable to find a browserify-shim config section in the package.json for /projectfolder/shared/node_modules/lodash/index.js while parsing file: /projectfolder/shared/node_modules/lodash/index.js
Modifying /projectfolder/shared/node_modules/lodash/package.json to contain an empty browserify-shim section (and doing the same for d3) works and generates exactly the same file as I get when I generate the file locally, however locally I don't have to modify any npm package. One possible explanation would be a lingering cache from browserify-incremental, but normally I deleted all cache directories, so that shouldn't happen.
Both are tested with browserify-shim 3.8.10 and browserify 10.2.6 (but I had the same issue two weeks ago with browserify-shim 3.8.9 and if I'm not mistaken a slightly older version of browserify).
The command leading to the error is
where the entry javascript file is passed through stdin to the browserify program