-
Notifications
You must be signed in to change notification settings - Fork 366
Error: only one instance of babel-polyfill is allowed #358
Comments
I'm experiencing the same issue with the dynamodb backend and the apollo client |
resolved this by removing babel-polyfill import from dynamodb/handler |
Will there be any issue if we remove it from dynamodb/handler |
@muke5hy @seiji-fli can you please test it and create a PR? |
Encountering the same error with the Twitter / |
Also having this same issue when using You can see this error gets thrown in many packages. https://github.com/search?p=2&q=_babelPolyfill&type=Code You can see where it doesn't do this check in https://github.com/sdd/serverless-dynalite/blob/5883f8abcb28349cf8d78edfa2a6f9af53b297a4/index.js#L3 |
+1 here with rds backend. Commenting out the babel-polyfill line fixes the issue for me |
That problem exists when the import of 'babel-polyfill' is in two part of your program. If you want use 'babel-polyfill' locally, put in your code a validation which filter by NODE_ENV (development or production) or remove import or require 'babel-polyfill' when pass to production |
Hi I'm getting following error. My Node version is 9.11.2
Serverless: POST /graphql (λ: graphql) Serverless: The first request might take a few extra seconds Serverless: Error while loading graphql [ 'Error: only one instance of babel-polyfill is allowed', 'at Object.<anonymous> (/Users/mukesh/Projects/serverless-graphql/app-backend/dynamodb/node_modules/babel-polyfill/lib/index.js:10:9)', 'at Module._compile (internal/modules/cjs/loader.js:654:30)', 'at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)', 'at Module.load (internal/modules/cjs/loader.js:566:32)', 'at tryModuleLoad (internal/modules/cjs/loader.js:506:12)', 'at Function.Module._load (internal/modules/cjs/loader.js:498:3)', 'at Module.require (internal/modules/cjs/loader.js:598:17)', 'at require (internal/modules/cjs/helpers.js:11:18)', 'at Object.<anonymous> (/Users/mukesh/Projects/serverless-graphql/app-backend/dynamodb/.webpack/service/handler.js:128:18)', 'at __webpack_require__ (/Users/mukesh/Projects/serverless-graphql/app-backend/dynamodb/.webpack/service/handler.js:20:30)', 'at Object.<anonymous> (/Users/mukesh/Projects/serverless-graphql/app-backend/dynamodb/.webpack/service/handler.js:81:1)', 'at __webpack_require__ (/Users/mukesh/Projects/serverless-graphql/app-backend/dynamodb/.webpack/service/handler.js:20:30)', 'at /Users/mukesh/Projects/serverless-graphql/app-backend/dynamodb/.webpack/service/handler.js:63:18', 'at Object.<anonymous> (/Users/mukesh/Projects/serverless-graphql/app-backend/dynamodb/.webpack/service/handler.js:66:10)', 'at Module._compile (internal/modules/cjs/loader.js:654:30)', 'at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)', 'at Module.load (internal/modules/cjs/loader.js:566:32)', 'at tryModuleLoad (internal/modules/cjs/loader.js:506:12)', 'at Function.Module._load (internal/modules/cjs/loader.js:498:3)', 'at Module.require (internal/modules/cjs/loader.js:598:17)', 'at require (internal/modules/cjs/helpers.js:11:18)', 'at Object.createHandler (/Users/mukesh/Projects/serverless-graphql/app-backend/dynamodb/node_modules/serverless-offline/src/functionHelper.js:35:21)', 'at handler (/Users/mukesh/Projects/serverless-graphql/app-backend/dynamodb/node_modules/serverless-offline/src/index.js:499:40)', 'at Object.internals.handler (/Users/mukesh/Projects/serverless-graphql/app-backend/dynamodb/node_modules/hapi/lib/handler.js:96:36)', 'at request._protect.run (/Users/mukesh/Projects/serverless-graphql/app-backend/dynamodb/node_modules/hapi/lib/handler.js:30:23)', 'at module.exports.internals.Protect.internals.Protect.run (/Users/mukesh/Projects/serverless-graphql/app-backend/dynamodb/node_modules/hapi/lib/protect.js:64:5)', 'at exports.execute (/Users/mukesh/Projects/serverless-graphql/app-backend/dynamodb/node_modules/hapi/lib/handler.js:24:22)', 'at each (/Users/mukesh/Projects/serverless-graphql/app-backend/dynamodb/node_modules/hapi/lib/request.js:384:16)', 'at iterate (/Users/mukesh/Projects/serverless-graphql/app-backend/dynamodb/node_modules/items/lib/index.js:36:13)', 'at done (/Users/mukesh/Projects/serverless-graphql/app-backend/dynamodb/node_modules/items/lib/index.js:28:25)', 'at internals.Auth.payload (/Users/mukesh/Projects/serverless-graphql/app-backend/dynamodb/node_modules/hapi/lib/auth.js:223:16)', 'at each (/Users/mukesh/Projects/serverless-graphql/app-backend/dynamodb/node_modules/hapi/lib/request.js:384:16)', 'at iterate (/Users/mukesh/Projects/serverless-graphql/app-backend/dynamodb/node_modules/items/lib/index.js:36:13)', 'at done (/Users/mukesh/Projects/serverless-graphql/app-backend/dynamodb/node_modules/items/lib/index.js:28:25)', 'at onParsed (/Users/mukesh/Projects/serverless-graphql/app-backend/dynamodb/node_modules/hapi/lib/route.js:402:20)', 'at Subtext.parse (/Users/mukesh/Projects/serverless-graphql/app-backend/dynamodb/node_modules/hapi/lib/route.js:423:20)', 'at next (/Users/mukesh/Projects/serverless-graphql/app-backend/dynamodb/node_modules/subtext/lib/index.js:45:26)', 'at Wreck.read (/Users/mukesh/Projects/serverless-graphql/app-backend/dynamodb/node_modules/subtext/lib/index.js:242:16)', 'at finish (/Users/mukesh/Projects/serverless-graphql/app-backend/dynamodb/node_modules/subtext/node_modules/wreck/lib/index.js:374:20)', 'at wrapped (/Users/mukesh/Projects/serverless-graphql/app-backend/dynamodb/node_modules/hoek/lib/index.js:875:20)', 'at module.exports.internals.Recorder.onReaderFinish (/Users/mukesh/Projects/serverless-graphql/app-backend/dynamodb/node_modules/subtext/node_modules/wreck/lib/index.js:449:16)', 'at Object.onceWrapper (events.js:272:13)', 'at module.exports.internals.Recorder.emit (events.js:185:15)', 'at module.exports.internals.Recorder.emit (domain.js:440:23)', 'at finishMaybe (_stream_writable.js:636:14)', 'at endWritable (_stream_writable.js:644:3)', 'at module.exports.internals.Recorder.Writable.end (_stream_writable.js:586:5)', 'at IncomingMessage.onend (_stream_readable.js:607:10)', 'at Object.onceWrapper (events.js:272:13)', 'at IncomingMessage.emit (events.js:185:15)', 'at IncomingMessage.emit (domain.js:422:20)', 'at endReadableNT (_stream_readable.js:1106:12)' ] Serverless: Replying error in handler
The text was updated successfully, but these errors were encountered: