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

content being set to '"undefined"' in rollup context #139

Open
gaberudy opened this issue Mar 28, 2018 · 1 comment
Open

content being set to '"undefined"' in rollup context #139

gaberudy opened this issue Mar 28, 2018 · 1 comment

Comments

@gaberudy
Copy link

I'm sorry I don't have a small reproducable case, but when when using rollup with rollup-plugin-commonjs and importing graphql, there is some weird things going on this line:

if (chunk.edited && chunk.content.length) {

See the screenshot here:

rollup/rollup#1859 (comment)

Essentially, in some previous code magicstring set content to the string 'undefined' (maybe here?):

chunk.content = chunk.content.replace(pattern, replacer);

@gaberudy
Copy link
Author

From extracting the context from the rollup code, there is a MagicString instance based on the original string:

import * as graphql from "/Users/grudy/dev/stable/jsapp/node_modules/graphql/index.mjs"; export default ( graphql && graphql['default'] ) || graphql;

and it is calling the member overwrite(117, 124, "graphql$1", {storeName: true, contentOnly: false });

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

No branches or pull requests

2 participants