GeekyAnts / nativebase-templates

NativeBase Templates for different platforms.
72 stars 76 forks source link

SyntaxError: Cannot use import statement outside a module #36

Open galacoder opened 2 years ago

galacoder commented 2 years ago

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 commented 2 years ago

having same behavior here

Wilson-Lim commented 2 years ago

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