Skip to content
This repository has been archived by the owner on Dec 21, 2018. It is now read-only.

Null "browser" values appear to break downstream webpack builds #1

Closed
jeffbaumes opened this issue Jan 26, 2018 · 2 comments · Fixed by #2
Closed

Null "browser" values appear to break downstream webpack builds #1

jeffbaumes opened this issue Jan 26, 2018 · 2 comments · Fixed by #2

Comments

@jeffbaumes
Copy link
Contributor

In the candela library, which depends on vega and uses webpack, we started seeing the following error earlier today:

Undefined identifier
/Users/jeff/code/candela/node_modules/enhanced-resolve/lib/Resolver.js:184
	var idxQuery = identifier.indexOf("?");
	                          ^

TypeError: Cannot read property 'indexOf' of null
    at Resolver.parse (/Users/jeff/code/candela/node_modules/enhanced-resolve/lib/Resolver.js:184:28)

It is being triggered by some logic in enhanced-resolve when attempting to load canvas from vega-canvas. The value of data is null (not undefined or false), so it passes the checks and gets sent on to lower stacks until it is eventually referenced and gets the indexOf error (doRequest() is called with the request field set to null):

 31 		var data = typeof data1 !== "undefined" ? data1 : data2;
 32 		if(data === innerRequest) return callback();
 33 		if(data === undefined) return callback();
 34 		if(data === false) {
 35 			var ignoreObj = Object.assign({}, request, {
 36 				path: false
 37 			});
 38 			return callback(null, ignoreObj);
 39 		}
 40 		var obj = Object.assign({}, request, {
 41 			path: request.descriptionFileRoot,
 42 			request: data
 43 		});
 44 		resolver.doResolve(target, obj, "aliased from description file " + request.descriptionFilePath + " with mapping '" + innerRequest + "' to '" + data + "'", createInnerCallback(function(err, result) {

I don't know anything about the browser field in package.json, but this spec seems to suggest using false, and does not mention the use of null. Should nulls be changed to false or undefined in package.json instead to make tools like webpack happy?

That's the best analysis I can do with limited knowledge on the subject.

manthey added a commit to girder/girder that referenced this issue Jan 29, 2018
The most recent version of vega depends on vega-canvas, but that doesn't
build with webpack.  See vega/vega-canvas#1.
This pins enough of vega to avoid the problem.

This can be reverted when candela publishes a work around or the problem
is fixed in vega-canvas.
@domoritz
Copy link
Member

This is also causing build issues in ipyvega and jupyter renderers.

@domoritz
Copy link
Member

However, I can compile successfully with webpack 1. #jsproblems

@jheer jheer closed this as completed in #2 Jan 30, 2018
zachmullen pushed a commit to Kitware/candela that referenced this issue Oct 4, 2018
The most recent version of vega depends on vega-canvas, but that doesn't
build with webpack.  See vega/vega-canvas#1.
This pins enough of vega to avoid the problem.

This can be reverted when candela publishes a work around or the problem
is fixed in vega-canvas.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants