Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Why check parent element import source match child's import source #1192

Answered by Archmonger
zx013 asked this question in Question
Discussion options

When I use web.module_from_url to load two js module, but I cannot use two component at the same time. It will cause error blew.
bundle.min.js:4 Parent element import source {"source":"/static/bundle.min.js","sourceType":"URL"} does not match child's import source {"source":"/static/bundle02.min.js","sourceType":"URL"}
So I saw source code, then I found createImportSourceElement func in reactpy-vdom.tsx.

 if (
 !isImportSourceEqual(props.currentImportSource, props.model.importSource)
 ) {
 console.error(
 "Parent element import source " +
 stringifyImportSource(props.currentImportSource) +
 " does not match child's import source " +
 stringifyImportSource(props.model.importSource),
 );
 return null;
 }

I do not know why check this?

You must be logged in to vote

We currently do not support mix-and-matching components from different import sources. Some changes will be needed to support this safely. This feature will come in a future update.

Replies: 1 comment

Comment options

We currently do not support mix-and-matching components from different import sources. Some changes will be needed to support this safely. This feature will come in a future update.

You must be logged in to vote
0 replies
Answer selected by Archmonger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /