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

ES6 style import text inside of string breaks packager #6323

Closed
jaulz opened this issue Mar 6, 2016 · 5 comments
Closed

ES6 style import text inside of string breaks packager #6323

jaulz opened this issue Mar 6, 2016 · 5 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@jaulz
Copy link
Contributor

jaulz commented Mar 6, 2016

// assign test to the string "import test from 'test'"
var test = `import test from 'test'`

It seems that as soon as you try to have a variable that contains the string to import a module the packer breaks. It's really easy to reproduce: https://rnplay.org/apps/FBm0LQ
The obvious workaround is to have a variable that concatenates the string but does that make sure that there are no other side effects?

@satya164
Copy link
Contributor

satya164 commented Mar 6, 2016

cc @martinbigio

@brentvatne
Copy link
Collaborator

Also cc @cpojer

@brentvatne brentvatne changed the title var test = import test from 'test' ES6 style import text inside of string breaks packager Mar 6, 2016
@cpojer
Copy link
Contributor

cpojer commented Mar 6, 2016

We don't use static analysis to analyze dependencies but rather just regex, for performance reasons. Unfortunately that means we can't ignore strings that look like imports/require's. As you suggested, the workaround is string concatenation.

@cpojer cpojer closed this as completed Mar 6, 2016
@jaulz
Copy link
Contributor Author

jaulz commented Mar 6, 2016

Thanks for the quick answers and good to know :)
@cpojer any hint where I can find that part of the code?

@cpojer
Copy link
Contributor

cpojer commented Mar 6, 2016

@facebook facebook locked as resolved and limited conversation to collaborators May 24, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

6 participants