Cannot use import statement outside a module
When running the cdk example the following error occurs when running cdk bootstrap:
import 'source-map-support/register';
^^^^^^
SyntaxError: Cannot use import statement outside a module
hey @elie222 can you provide more information about your setup:
- output of
npx next info - did you used
npmoryarn?
Maybe @GuiBibeau @leerob can help here because this is the AWS S3 image example, right?
This PR #296 was also merged after your issue was created.
It could be related to the version of Node.js you're using (guess).
I also ran into a similar issue use, tried both npm and yarn.
Operating System: Platform: darwin Arch: x64 Node: 18.4.0 npm: 8.12.1 Yarn: 1.22.11 pnpm: N/A Relevant packages: next: 12.1.6 react: 18.2.0 react-dom: 18.2.0
Same issue with output of npx next info
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 21.6.0: Binaries: Node: 16.16.0 npm: 8.11.0 Yarn: 1.22.19 pnpm: N/A Relevant packages: next: 12.2.4 eslint-config-next: 12.2.4 react: 18.2.0 react-dom: 18.2.0
Hey everyone. The issue is that AWS CDK typescript code requires a bit different tsconfig settings. You can find the details in the linked PR i just pushed.