ncc: npm package `optional` doesn't work on next-server

Found a problem while using nestjs. They have some stuff using the optional package, and it doesn’t get transpiled properly by webpack

Made an issue over on their repo too:

https://github.com/nestjs/nest/issues/2213

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Comments: 17 (6 by maintainers)

Most upvoted comments

It didn’t work with now dev because I don’t have XCode installed.

But when I deploy I get a similar error to #377


GraphQL schema file generated at: /var/task/src/schema.gql
--
OUTPUT | May 24 2019 14:40:03:865 | /src/main.ts | [Nest] 1   - 2019-05-24 18:40   [NestFactory] Starting Nest application...
OUTPUT | May 24 2019 14:40:03:867 | /src/main.ts | (node:1) Warning: N-API is an experimental feature and could change at any time.
OUTPUT | May 24 2019 14:40:03:881 | /src/main.ts | [Nest] 1   - 2019-05-24 18:40   [InstanceLoader] AppModule dependencies initialized +16ms
OUTPUT | May 24 2019 14:40:03:882 | /src/main.ts | [Nest] 1   - 2019-05-24 18:40   [InstanceLoader] GraphQLModule dependencies initialized +1ms
OUTPUT | May 24 2019 14:40:03:887 | /src/main.ts | [Nest] 1   - 2019-05-24 18:40   [RoutesResolver] IndexController {/}: +5ms
OUTPUT | May 24 2019 14:40:03:890 | /src/main.ts | [Nest] 1   - 2019-05-24 18:40   [RouterExplorer] Mapped {/, GET} route +3ms
OUTPUT | May 24 2019 14:40:04:006 | /src/main.ts | { Error: Generating schema error     at Function.<anonymous> (/var/task/src/main.ts:114941:27)     at Generator.next (<anonymous>)     at fulfilled (/var/task/src/main.ts:209539:62)     at <anonymous>     at process._tickDomainCallback (internal/process/next_tick.js:228:7)     at Function.Module.runMain (module.js:695:11)     at startup (bootstrap_node.js:188:16)     at bootstrap_node.js:609:3   details:     [ { Type Query must define one or more fields.     at SchemaValidationContext.reportError (/var/task/src/main.ts:222921:19)     at validateFields (/var/task/src/main.ts:223140:13)     at validateTypes (/var/task/src/main.ts:223103:9)     at validateSchema (/var/task/src/main.ts:222885:3)     at graphqlImpl (/var/task/src/main.ts:465526:61)     at /var/task/src/main.ts:465501:250     at new Promise (<anonymous>)     at Object.graphql (/var/task/src/main.ts:465499:10)     at Function.<anonymous> (/var/task/src/main.ts:114939:52)     at Generator.next (<anonymous>) message: 'Type Query must define one or more fields.' } ] }

image