Comments (5)
Full error stack
Uncaught TypeError: Cannot set property 'exports' of undefined scripts.js:9785
defineExport scripts.js:9785
browserifyShim scripts.js:9783
browserifyShim scripts.js:9785
require.en0Fjs scripts.js:9789
s scripts.js:1
(anonymous function) scripts.js:1
require../chat scripts.js:747
s scripts.js:1
e scripts.js:1
(anonymous function)
from grunt-browserify.
@shama, any thoughts on this? Thinking it's an issue with g-b's interface to grunt, since the file contents are exactly the same...
from grunt-browserify.
It looks like something isn't getting wrapped properly if module
is undefined
. I'm having trouble reproducing though. @Fauntleroy Could you post your example to a repo where we can download and test?
from grunt-browserify.
I'm running into the same issue. What I'm seeing is that shim'ed modules get wrapped n
times by browserifyShim
, where n
is the index of file being compiled in files
.
For example, if I have a browserify config like this:
files: {
'a': ['a.js'],
'b': ['b.js']
},
options: {
shim: {
'swfobject': {
path: 'lib/swfobject.js',
exports: 'swfobject'
}
},
and both "a" and "b" require('swfobject')
:
"a"'s swfobject shim will work correctly:
var global = self;
(function browserifyShim(module, exports, define, browserify_shim__define__module__export__) {
...
but "b"'s swfobject will wrap the module two times:
var global = self;
(function browserifyShim(module, exports, define, browserify_shim__define__module__export__) {
(function browserifyShim(module, exports, define, browserify_shim__define__module__export__) {
...
from grunt-browserify.
That makes sense then. shims
is defined outside the forEachSeries
processing of files; moving inside the iterator function should solve the problem, I think. I'll take a look this weekend.
from grunt-browserify.
Related Issues (20)
- messy code with Chinese characters in source maps HOT 2
- Edge Issue with stream-http HOT 2
- please tag new releases HOT 1
- support using browserify-lite as an option HOT 6
- Multiple Browserify tasks HOT 4
- npm install ! has error!
- Using alias miss the export.module = library HOT 2
- browserifyOptions mapping unclear HOT 2
- Unable to specify plugin/transform order HOT 1
- does not work with uglifyify
- next release? HOT 9
- cacheFile not working HOT 16
- How to use browserify-hmr plugin for multi bundles
- update examples
- browser unable to load latest node version HOT 1
- 5.2.1 Release for Browserify Update HOT 6
- Is it possible to have multiple 'standalone':s?
- Outputted bundle is not correct. Example case inside:
- grunt-browserify isn't compatible with Node.js v12 HOT 5
- Old version dependecy async: 1.5.2 version causing High vulnerability (npm audit)
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 grunt-browserify.