Unknown shader module project32
Description
My usage of path layer leads to error: "Unknown shader module project32" Same goes for this example: https://deck.gl/showcases/gallery/highway
Repro Steps
Use example above.
Environment (please complete the following information):
- Framework Version:
- Browser Version: Version 76.0.3809.6 (Official Build) canary (64-bit)
- OS: Mac OS X 10.14.5
Logs
dist.min.js:1 deck: error while initializing PathLayer({id: 'path-layer'})
Error: Unknown shader module project32
at i (dist.min.js:1)
at e.value (dist.min.js:1)
at dist.min.js:1
at Array.map (
Actually this bug appears on a few examples. It also does not depend on Browser, both Safari and Chrome are affected.
Happens with GeoJson Layer as well.
Error message:
dist.min.js:1 deck: error while initializing PathLayer({id: 'GeoJsonLayer-line-strings'})
Error: Unknown shader module project32
const geojsonLayer = new deck.GeoJsonLayer({
data: fc,
pickable: false,
stroked: false,
filled: false,
extruded: false,
lineWidthScale: 20,
lineWidthMinPixels: 2,
getFillColor: [160, 160, 180, 255],
getLineColor: [160, 160, 180, 255],
getLineWidth: 10,
opacity: 0.8,
wireframe: true,
fp64: true,
getElevation: 100,
});
Where "fc" is a FeatureCollection only consisting of one LineString with hundreds of coordinates.
var fc = {
"type": "FeatureCollection",
"features": [
feature
]
}
@cschlueter Thanks for reporting. Please use https://unpkg.com/[email protected]/dist.min.js as we address this issue.
@ibgreen Tree shaking is broken by https://github.com/uber/deck.gl/pull/3202.
Fixed in 7.1.2. It is available on either
https://unpkg.com/[email protected]/dist.min.js
or
https://unpkg.com/deck.gl@latest/dist.min.js.
The ^7.0.0 cache on unpkg.com may need some time to refresh.
Thanks, selecting the version 7.1.2 explicitly did the trick.
I still getting this error on 7.1.4 with ScatterplotLayer without using pre-bundled versions.
I'm still blocked by this issue when trying to build an application with the following config:
{
"engineStrict": true,
"scripts": {
"watch": "webpack -d --watch",
"build": "webpack -p --progress",
"rollup-build": "npx rollup -c"
},
"dependencies": {
"nebula.gl": "^0.14.0",
"nebula.gl-react": "^0.10.5",
"react": "16.5.0",
"react-dom": "16.5.0",
"react-map-gl": "^5.0.3"
},
"resolutions": {
"@deck.gl/core": "7.2.0-alpha.1"
},
"devDependencies": {
"@babel/core": "^7.0.0",
"@babel/plugin-proposal-class-properties": "^7.0.0",
"@babel/plugin-proposal-decorators": "^7.0.0",
"@babel/plugin-proposal-export-default-from": "^7.2.0",
"@babel/plugin-proposal-export-namespace-from": "^7.0.0",
"@babel/plugin-proposal-function-sent": "^7.0.0",
"@babel/plugin-proposal-json-strings": "^7.0.0",
"@babel/plugin-proposal-numeric-separator": "^7.0.0",
"@babel/plugin-proposal-throw-expressions": "^7.0.0",
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
"@babel/plugin-syntax-import-meta": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/preset-flow": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"babel-loader": "^8.0.0",
"babel-preset-minify": "^0.5.0",
"bourbon": "^4.3.4",
"css-loader": "^0.28.11",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"file-loader": "^0.11.2",
"rollup": "^1.15.3",
"rollup-plugin-babel": "^4.3.0",
"rollup-plugin-commonjs": "^9.2.0",
"rollup-plugin-json": "^3.1.0",
"rollup-plugin-node-builtins": "^2.1.2",
"rollup-plugin-node-globals": "^1.4.0",
"rollup-plugin-node-resolve": "^4.0.0",
"rollup-plugin-replace": "^2.1.0",
"url-loader": "^0.5.9",
"webpack": "^4.34.0",
"webpack-cli": "^3.3.4"
}
}
I have tried different versions of @deck.gl/core after 7.1 but I can't seem to find the initializeShaderModules in the generated bundle. Am I missing something?
@sebastibe Can you try the following:
- Check if the global object
deckexists in the console, anddeck.versionmatches your installed version (7.2.0-alpha.1). - With source map on, see if https://github.com/uber/deck.gl/blob/master/modules/core/src/lib/init.js#L46 is executed.
- One weird thing I noticed is that I always seem to have the
deckversion one minor version below the one required: (7.1.6 if I require 7.2.0-alpha.1, 7.1.5 if I require 7.1.6 etc...) - I don't find the
initializeShaderModulesfunction in the source maps which could indicate I might have an issue with my webpack config. Here it is below for reference:
const resolve = require('path').resolve;
const join = require('path').join;
const dirname = require('path').dirname;
const webpack = require('webpack');
const BUILD_DIR = resolve(__dirname, 'target', 'cljsbuild', 'public');
const APP_DIR = resolve(__dirname, 'src', 'js');
const SCSS_DIR = resolve(__dirname, 'src', 'sass');
const MAP_GL_CSS_DIR = resolve(__dirname, 'node_modules', 'mapbox-gl');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const extractSass = new ExtractTextPlugin({
// filename: "[name].[contenthash].css"
filename: "css/[name].css"
// disable: process.env.NODE_ENV === "development"
});
const config = {
entry: [
`${APP_DIR}/main.js`,
`${MAP_GL_CSS_DIR}/dist/mapbox-gl.css`,
],
output: {
path: BUILD_DIR,
filename: 'js/bundle.js'
},
resolve: {
extensions: ['.js', '.scss']
},
module: {
rules: [
// Compile ES2015 using babel
{
test: /\.js$/,
use: {
loader: 'babel-loader',
options: {
presets: [
require('@babel/preset-env'),
require('@babel/preset-react'),
require('@babel/preset-flow')
],
plugins: [
require('@babel/plugin-proposal-class-properties'),
require('@babel/plugin-proposal-export-default-from')
]
},
},
exclude: /node_modules/,
include: [resolve('.')]
},
{
// webpackl 4 fix for broken turf module: https://github.com/uber/nebula.gl/issues/64
test: /\.mjs$/,
include: /node_modules/,
type: 'javascript/auto'
},
{
test: /\.css$/,
use: extractSass.extract({
use: [{
loader: "css-loader", // translates CSS into CommonJS
options: {
includePaths: [
// From mapbox-gl-js README.
// Required for non-browserify bundlers (e.g. webpack):
join(dirname(module.filename), 'node_modules/mapbox-gl/dist'),
// join(dirname(module.filename), 'node_modules/weather-icons/css')
]
}
}],
fallback: "style-loader" // creates style nodes from JS strings
})
},
{
test: /\.scss$/,
use: extractSass.extract({
use: [{
loader: "css-loader" // translates CSS into CommonJS
}, {
loader: "sass-loader", // compiles Sass to CSS
options: {
includePaths: [
join(dirname(module.filename), 'node_modules')
]
}
}],
fallback: "style-loader" // creates style nodes from JS strings
})
},
{
test: /\.(woff|woff2)$/,
use: {
loader: 'url-loader',
options: {
name: 'fonts/[hash].[ext]',
limit: 5000,
mimetype: 'application/font-woff'
}
}
}, {
test: /\.(ttf|eot|svg)$/,
use: {
loader: 'file-loader',
options: {
name: 'fonts/[hash].[ext]'
}
}
}
]
},
plugins: [
extractSass,
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production')
})
]
};
module.exports = config;
@sebastibe Your package.json does not explicitly depend on any deck.gl packages. They are not dependencies of the latest nebula.gl either.
nebula-react looks like a deprecated package since it's depending on an old version of nebula.gl which depends on an older version of deck.gl.
The ultimate test is always running yarn list @deck.gl/core to see exactly how many copies and what versions are installed.
@cschlueter This doesn't seem to be related to your issue, feel free to close and we can move to a different thread.
@Pessimistress I'm still blocked on this issue.
- I have confirmed that I could have a clean install and only one version of deck.gl with the following packages:
"@deck.gl/core": "^7.1.7",
"@deck.gl/layers": "^7.1.7",
"@deck.gl/react": "^7.1.7",
"@luma.gl/constants": "^7.1.1",
"@luma.gl/core": "^7.1.1",
"@nebula.gl/layers": "^0.14.0",
- I have confirmed that the
initializeShaderModulesfunction was called with the debugger.
I'm a bit out of imagination on where to go from here, any ideas?
@sebastibe Can you run yarn list @luma.gl/core
╰─ yarn list @luma.gl/core
yarn list v1.16.0
└─ @luma.gl/[email protected]
Nothing jumps out to me from the information you've shared. This error might be caused by one of the following:
- Multiple copies of
@deck.gl/coreor@luma.gl/corein node_modules. This can be verified withyarn list <package>. The fix is to use matching dependency versions in package.json, removeyarn.lockand perform a clean install. - Multiple copies of
@deck.gl/coreor@luma.gl/coreas a result of some local setup, such asyarn link, use ofmodule-aliasmodule,resolve.aliasin webpack config, inclusion of both locally-bundled and pre-bundled versions, etc. - Overly aggressive tree shaking - I've seen this if the
sideEffectsfield in package.json is not respected, usually due to a custom minifier config. This can be verified by checking if the globaldeckobject exists in the runtime console.
This error occurred when I used @deck.gl/geo-layers to create TripsLayers.
@Pessimistress According to the tips,I deleted the node_modules and yarn.lock files and reinstalled them using yarn install, but this error still appears.I have no used of module-alias and minifier config.
This is a screenshot of the browser console error, which keeps growing.
In addition, there is another error:
Packages:
"deck.gl": "^7.1.10",
"@deck.gl/core": "^7.1.10",
"@deck.gl/mapbox": "^7.1.10",
"@deck.gl/geo-layers": "^7.1.10",
Am I missing something?:frowning:
I am seeing this issue as well. I am using npm to install my packages and it is an angular application. I am building the application with ng build --prod which is using webpack under the hood.
The deck.gl version I am using is 7.1.10. I have switched to including deck.gl via <script src="https://unpkg.com/deck.gl@latest/dist.min.js"></script> which is not optimal, but functions as a workaround until I can have it properly included in my application when building.
Any update on this? I'm having the same issue
"@deck.gl/core": "^7.1.10",
"@deck.gl/mapbox": "^7.1.10",
"@loaders.gl/images": "^1.1.6",
"@luma.gl/constants": "^7.1.1",
"deck.gl": "^7.1.10",
"luma.gl": "^7.1.1",
A clean install doesn't solve it
@mbarrenechea have you tried run yarn list @luma.gl/core? Most likely you have multiple copies because Luma is already a dependency of deck.
Just an update I changed my dependencies to
"deck.gl": "7.0.0",
"luma.gl": "^7.1.1",
and now it works... Who knows....
@Pessimistress yes I run it and I only had one
yarn list @luma.gl/core
yarn list v1.17.0
└─ @luma.gl/[email protected]