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

SyntaxError: Cannot use import statement outside a module #36

Open
galacoder opened this issue Feb 17, 2022 · 2 comments
Open

SyntaxError: Cannot use import statement outside a module #36

galacoder opened this issue Feb 17, 2022 · 2 comments

Comments

@galacoder
Copy link

galacoder commented Feb 17, 2022

Hi there.

I am trying to use universal-app-template-nativebase-typescript and got this error while running yarn start:web. Check the code below.

Please advise!

Thank you.

``
yarn start:web
yarn run v1.22.17
$ yarn --cwd apps/web run dev
$ next
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5
info - automatically enabled Fast Refresh for 1 custom loader
info - Using external babel configuration from /dev/action/test/@native-base-free-starter/monorepo-template/apps/web/babel.config.js
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
info - Using external babel configuration from /Users/dev/action/test/@native-base-free-starter/monorepo-template/apps/web/babel.config.js
info - Using external babel configuration from /Users/dev/action/test/@native-base-free-starter/monorepo-template/apps/web/babel.config.js
info - Using external babel configuration from /Users/dev/action/test/@native-base-free-starter/monorepo-template/apps/web/babel.config.js
info - Using external babel configuration from /Users/dev/action/test/@native-base-free-starter/monorepo-template/apps/web/babel.config.js
info - Using external babel configuration from /Users/dev/action/test/@native-base-free-starter/monorepo-template/apps/web/babel.config.js
info - Using external babel configuration from /Users/dev/action/test/@native-base-free-starter/monorepo-template/apps/web/babel.config.js
info - Using external babel configuration from /Users/dev/action/test/@native-base-free-starter/monorepo-template/apps/web/babel.config.js
info - Using external babel configuration from /Users/dev/action/test/@native-base-free-starter/monorepo-template/apps/web/babel.config.js
info - Using external babel configuration from /Users/dev/action/test/@native-base-free-starter/monorepo-template/apps/web/babel.config.js
info - Using external babel configuration from /Users/dev/action/test/@native-base-free-starter/monorepo-template/apps/web/babel.config.js
info - Using external babel configuration from /Users/dev/action/test/@native-base-free-starter/monorepo-template/apps/web/babel.config.js
event - compiled successfully
event - build page: /
wait - compiling...
event - compiled successfully
event - build page: /next/dist/pages/_error
wait - compiling...
event - compiled successfully
/Users/dev/action/test/@native-base-free-starter/monorepo-template/node_modules/react-native-web/dist/exports/StyleSheet/createCompileableStyle.js:11
import normalizeValueWithProperty from './normalizeValueWithProperty';
^^^^^^

SyntaxError: Cannot use import statement outside a module
at Object.compileFunction (node:vm:352:18)
at wrapSafe (node:internal/modules/cjs/loader:1032:15)
at Module._compile (node:internal/modules/cjs/loader:1067:27)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.react-native-web/dist/exports/StyleSheet/createCompileableStyle (/Usersdev/action/test/@native-base-free-starter/monorepo-template/apps/web/.next/server/pages/_app.js:7712:18)
at webpack_require (/Users/dev/action/test/@native-base-free-starter/monorepo-template/apps/web/.next/server/webpack-runtime.js:33:42)
info - automatically enabled Fast Refresh for 1 custom loader
/Users/dev/action/test/@native-base-free-starter/monorepo-template/node_modules/react-native-web/dist/exports/StyleSheet/createCompileableStyle.js:11
import normalizeValueWithProperty from './normalizeValueWithProperty';
^^^^^^
``

@mihailt
Copy link

mihailt commented Mar 16, 2022

having same behavior here

@Wilson-Lim
Copy link

Updating react-native-web to "0.17.7" will fix the issue

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

No branches or pull requests

3 participants