-
Notifications
You must be signed in to change notification settings - Fork 282
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
Filenames of resources must be unique to avoid a crash #65
Comments
Duplicating the original directory structure would be another way to solve it (would still require a rewrite of the output file path). |
There is deduping applied in https://github.com/zeit/ncc/blob/master/src/asset-relocator.js#L40 which should exactly be resulting in schema and schema1 being emitted. I suspect this may actually be due to a static analysis failure as opposed to a deduping failure - where one is not being statically analyzed and the other is, but we won't know until we can verify the exact JS expression that loads both of these. |
@baboons do you have an exact replication here that we can look at? |
(duplicate assets are already unit tested in https://github.com/zeit/ncc/blob/master/test/unit/asset-fs-inlining-multi/input.js) |
I'll close until we hear from @baboons whether this is happening on 0.3.0+ |
Considering the examples for NCC with Apollo and an abstract structure with schemas as resources and sharing the same filenames. This will cause NCC to compile the first/last file only, and throwing an error.
Output
At the moment this can only be resolved by renaming one of the schemas and make sure the file names are unique:
const typeDefs = String(fs.readFileSync(__dirname + "/schema2.gql"));
Output
The text was updated successfully, but these errors were encountered: