Skip to content
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

Test failure: 'root' is deprecated, use 'global' #1458

Closed
saschanaz opened this issue Jan 30, 2018 · 9 comments
Closed

Test failure: 'root' is deprecated, use 'global' #1458

saschanaz opened this issue Jan 30, 2018 · 9 comments

Comments

@saschanaz
Copy link
Member

https://travis-ci.org/w3c/respec/jobs/335038255

Not sure what happened there...

@saschanaz
Copy link
Member Author

ReSpec error: (node:6910) DeprecationWarning: 'root' is deprecated, use 'global'

This seems the cause. Strangely, I rollbacked to the last known good commit and it still happens there.

@saschanaz saschanaz changed the title Test fails on the main branch Test failure: 'root' is deprecated, use 'global' Jan 31, 2018
@saschanaz
Copy link
Member Author

saschanaz commented Jan 31, 2018

I think I got the cause. cc: @nileshgulia1

handlebars.js from dependencies starts with:

(function webpackUniversalModuleDefinition(root, factory) {
	if(typeof exports === 'object' && typeof module === 'object')
		module.exports = factory();
	else if(typeof define === 'function' && define.amd)
		define([], factory);
	else if(typeof exports === 'object')
		exports["Handlebars"] = factory();
	else
		root["Handlebars"] = factory();
})(this, function() {

Here, the UMD exporting code uses a variable root. Our build system somehow converts it to:

root = this,
factory = function() { /* ... */ },
"object" == typeof exports && "object" == typeof module ? module.exports = factory() : "function" == typeof define && define.amd ? define("handlebars.runtime", [], factory) : "object" == typeof exports ? exports.Handlebars = factory() : root.Handlebars = factory(),

This made Node.js angry where root is a deprecated alias of global.

@saschanaz
Copy link
Member Author

Still I have no idea why this is suddenly a problem, and only a problem for the last test.

@nileshgulia1
Copy link

Nice work @saschanaz I'll try to figure out the rest.

@saschanaz
Copy link
Member Author

saschanaz commented Jan 31, 2018

Generated build result is different with the one in main repo, probably affected by some change in the dependencies. (The released code does not include root=this.)

@marcoscaceres
Copy link
Member

Just fyi, I’m in the middle of moving house, so will be a bit slow to respond to things till next week! Thanks nonetheless for looking into it.

@saschanaz
Copy link
Member Author

Oops, I was just to request uploading your local package-lock.json to see what update causes this issue 😄

It seems yarn.lock is now too old.

@marcoscaceres
Copy link
Member

Yeah, sorry there is both... npm 5 was... not a great release... so I had to switch between yarn and npm a few times.

@saschanaz
Copy link
Member Author

No worry, I got a fix 😁 #1461

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants