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

steal-clone path errors #1221

Closed
justinbmeyer opened this issue Jul 2, 2017 · 2 comments
Closed

steal-clone path errors #1221

justinbmeyer opened this issue Jul 2, 2017 · 2 comments
Labels

Comments

@justinbmeyer
Copy link
Contributor

justinbmeyer commented Jul 2, 2017

Originally, I thought this had to do with clone happening within dynamic imports. As demonstrated by #1222, I think there's just an error in steal-clone and how it determines paths.

Demonstrated by #1222.

This problem can be seen by cloning the updateDeep branch of canjs and changing test/test.js page to:

var order = Promise.resolve();

if (!System.isEnv('production')) {
	order = order.then(function(){
		return System.import('can-simple-map/can-simple-map_test');
	});
}
if (!System.isEnv('production')) {
	order = order.then(function(){
		return System.import('can-cid/test/test');
	});
}

Both of these tests use steal-clone. If only one System.import is present, everything works.
The error is that the can-cid test will not load:

canjs_tests_and_slack-_bitovi

I'm working on creating a smaller test right now that demonstrates this problem.

@justinbmeyer
Copy link
Contributor Author

This also fails if @loader is used everywhere:

var loader = require("@loader");

var order = Promise.resolve();

if (!System.isEnv('production')) {
	order = order.then(function(){
		return loader.import('can-simple-map/can-simple-map_test');
	});
}
if (!System.isEnv('production')) {
	order = order.then(function(){
		return loader.import('can-cid/test/test');
	});
}

@justinbmeyer
Copy link
Contributor Author

justinbmeyer commented Jul 2, 2017

I wasn't easily able to create this problem in steal. But I've reduced the canjs test to:

// test/test.js
var loader = require("@loader");
loader.import('can-simple-map/can-simple-map_test');
loader.import('can-cid/test/test');
// node_modules/can-simple-map/can-simple-map_test
var clone = require('steal-clone');
// node_modules/can-cid/test/test
require('can-cid/can-cid_test'); // relative here breaks too
// node_modules/can-cid/can-cid_test.js
var clone = require('steal-clone');
clone().import('can-cid')

Will keep reducing if I have time tomorrow.

justinbmeyer added a commit that referenced this issue Jul 2, 2017
@justinbmeyer justinbmeyer changed the title steal-clone within a dynamic import does not successfully load. steal-clone path errors Jul 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant