-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uncaught ReferenceError: n is not defined #4348
Comments
When I change source-map handling from:
to
the error disappears. Can someone shed some light on this? This has probably nothing to do with mapbox-gl, hasn't it? |
I would guess not. Make sure you're following the instructions in GETTING_STARTED.md. |
@oliverbienert did you figure out the issue? I ran into the same thing - very strange. I also changed the devtool/sourcemap, but I changed it to |
No, I didn't investigate further, for the moment. Because I use the react-mapbox-gl wrapper, I looked into their code but they seem to do it as described in GETTING_STARTED.md. |
Discussion seems to continue here: #4359 |
I ran into the same issue, and changing |
This is still happening, why is this issue closed ? It looks to me like mapbox is written in such way that will not survive minification. What are those "blobs" mentioned in the error ? Is mapbox trying to load some JS from somewhere that has to match some global variables declared in their scripts ? |
PS: Another way to make the error go away and still use sourcemaps is to set the sourceMap options for uglify plugin to true. {
plugins: [
new webpack.optimize.UglifyJsPlugin({
parallel: true,
sourceMap: true // <<<<
})
],
devtool: 'cheap-source-map' //or whatever
} |
Happened to me too. Changing it to:
fixed it, but I have no idea why, or what the hell this means. Can someone please explain, thanks |
Erase that ... My above solution doesn't seem to be working anymore for some reason :( But, I found a working solution here: #4359 (comment) |
excuse me. i see the 'devtool' to 'eval'. However, the error 'Uncaught ReferenceError: n is not defined' is still not work..why??? |
None of the solutions above worked but I tried another solution in @surdu's link
|
Hello, this is a project where I wrap mapbox-gl in react-mapbox-gl. The project is build with webpack. Since a couple of hours, perhaps since I reinstalled my node_modules folder, I have the above error in the console, which only happens in production mode. The app is loaded as usual but the above error occurs and the map stays empty.
On the contrary, in dev mode, all seems to work.
I'm quite lost.
Can someone help out? What else do you need to know?
mapbox version 0.32.1
The blob below is requested by mapbox-gl-js, as I see it when looking into network tab in chrome dev tools.
In this line the error is shown in the dev tools, underlined red:
package.json
The text was updated successfully, but these errors were encountered: