Skip to content

Android development fails with zen error TypeError: (0 , _typeof4.default) is not a function, on Win 10 Home x64 #1048

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

Closed
MassivDash opened this issue Mar 19, 2019 · 4 comments

Comments

@MassivDash
Copy link
Contributor

MassivDash commented Mar 19, 2019

Describe the bug
Enabling Android development in mobile .zenrc.js causes yarn watch to crash on

$ zen watch
zen error TypeError: (0 , _typeof4.default) is not a function
    at _typeof2 (d:\git\apollo starter\apollo-universal-starter-kit\node_modules\@babel\runtime\helpers\typeof.js:1:260)
    at _typeof (d:\git\apollo starter\apollo-universal-starter-kit\node_modules\@babel\runtime\helpers\typeof.js:4:39)
    at Object.<anonymous> (d:\git\apollo starter\apollo-universal-starter-kit\node_modules\core-js\modules\es6.symbol.js:65:51)
    at Module._compile (internal/modules/cjs/loader.js:654:30)
    at Module._compile (d:\git\apollo starter\apollo-universal-starter-kit\node_modules\pirates\lib\index.js:99:24)
    at Module._extensions..js (internal/modules/cjs/loader.js:665:10)
    at Object.newLoader [as .js] (d:\git\apollo starter\apollo-universal-starter-kit\node_modules\pirates\lib\index.js:104:7)
    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)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

To Reproduce
Steps to reproduce the behavior:
git clone stable
yarn
yarn seed
enable android development
yarn watch

(fresh install from today: 3.19.2019)

Expected behavior
Should work as expected

Desktop (please complete the following information):

  • win 10
  • developer mode enabled
  • tried node 9.10 and node 10.8 and node 10.15 LTS
  • yarn 1.9.4

Additional context

  • Running yarn watch with Android enabled and IOS enabled: false -> works as expected
  • running yarn watch with Android enabled (only): true -> fails with the same error
  • running yarn watch with iOS enabled (only): true -> fails with the same error
  • Running kit on linux (centos 7) ---> works as expected

After adding additional options to @babel-runtime

module.exports = {
  compact: false,
  presets: ['@babel/preset-typescript', '@babel/preset-react', ['@babel/preset-env', { modules: 'commonjs' }]],
  plugins: [
    '@babel/plugin-transform-modules-commonjs',
    '@babel/plugin-transform-destructuring',
    '@babel/plugin-transform-regenerator',
    ['@babel/plugin-transform-runtime', {
      helpers: false,
      regenerator: true,}],
    '@babel/plugin-proposal-class-properties',
    ['@babel/plugin-proposal-decorators', { legacy: true }],
    '@babel/plugin-proposal-object-rest-spread',
    ['styled-components', { ssr: true }],
    ['import', { libraryName: 'antd-mobile' }]
  ],
  env: {
    production: {
      compact: true
    }
  }
};

The app starts the web and backend server, the Android build fails with

zen error TypeError: Class constructor Module cannot be invoked without 'new'
    at new DelegatedModule (d:\git\apollo starter\apollo-universal-starter-kit\node_modules\webpack\lib\DelegatedModule.js:19:79)
    at d:\git\apollo starter\apollo-universal-starter-kit\node_modules\webpack\lib\DelegatedModuleFactoryPlugin.js:80:22
    at SyncWaterfallHook.eval (eval at create (d:\git\apollo starter\apollo-universal-starter-kit\node_modules\tapable\lib\HookCodeFactory.js:19:10), <anonymous>:7:16)
    at hooks.afterResolve.callAsync (d:\git\apollo starter\apollo-universal-starter-kit\node_modules\webpack\lib\NormalModuleFactory.js:153:40)
    at AsyncSeriesWaterfallHook.eval [as callAsync] (eval at create (d:\git\apollo starter\apollo-universal-starter-kit\node_modules\tapable\lib\HookCodeFactory.js:32:10), <anonymous>:6:1)
    at resolver (d:\git\apollo starter\apollo-universal-starter-kit\node_modules\webpack\lib\NormalModuleFactory.js:138:29)
    at process.nextTick (d:\git\apollo starter\apollo-universal-starter-kit\node_modules\webpack\lib\NormalModuleFactory.js:342:9)
    at process._tickCallback (internal/process/next_tick.js:61:11)

I also tried to exclude core.js in babel config --> exits with the same error "zen error TypeError: Class constructor Module cannot be invoked without 'new'".

yarn test fails with

yarn run v1.9.4
$ yarn tests && yarn lint
$ lerna run tests --stream
lerna notice cli v3.13.1
lerna info versioning independent
lerna info Executing command in 5 packages: "yarn run tests"
client-angular: $ cross-env NODE_ENV=test PORT=7070 zen test -t 10000 --full-trace "../../modules/**/client-angular/**/*.spec.*" "src/**/*.spec.*"
client-vue: $ cross-env NODE_ENV=test PORT=7070 zen test -t 10000 --full-trace "src/**/*.spec.*" "../../modules/**/client-vue/**/*.spec.*"
client: $ cross-env NODE_ENV=test PORT=7070 zen test -t 10000 --include src/__tests__/entry.ts --full-trace "src/**/*.spec.*" "../../modules/**/client-react/**/*.spec.*"
common: $ cross-env NODE_ENV=test PORT=7070 zen test -t 10000 --full-trace "../../modules/**/common-react/**/*.spec.*"
server: $ cross-env NODE_ENV=test PORT=7070 zen test -t 10000 --include src/__tests__/entry.ts --full-trace "src/**/*.spec.*" "../../modules/**/server-ts/**/*.spec.*"
client-angular: zen info Version 0.1.2
client-angular: zen info Running d:\git\apollo starter\apollo-universal-starter-kit\packages\client-angular\node_modules\.bin\mochapack.cmd --webpack-config d:\git\apollo starter\apollo-universal-starter-kit\node_modules\@larix\zen\webpack.config.js -t 10000 --full-trace ../../modules/**/client-angular/**/*.spec.* src/**/*.spec.*
client-angular: 'd:\git\apollo' is not recognized as an internal or external command,
client-angular: operable program or batch file.
client-angular: error Command failed with exit code 1.
client-angular: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
lerna ERR! yarn run tests exited 1 in 'client-angular'
lerna WARN complete Waiting for 4 child processes to exit. CTRL-C to exit immediately.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
@MassivDash MassivDash changed the title Android development fails with zen error TypeError: (0 , _typeof4.default) is not a function Android development fails with zen error TypeError: (0 , _typeof4.default) is not a function, on Win 10 Home x64 Mar 20, 2019
@larixer
Copy link
Member

larixer commented Mar 20, 2019

@MassivDash Tests fail because of the space in directory name apollo starter

@drockyy
Copy link

drockyy commented Jul 4, 2019

Hello, I have the same problem with the newest version (master) of the apollo starter kit

My routine was:
yarn
yarn seed
enable android builders in .spinrc.js (mobile)
yarn watch

And I have a machine with OS Windows 10, too.

$ yarn watch
yarn run v1.12.3
$ spin watch
spin error TypeError: (0 , _typeof4.default) is not a function
at _typeof2 (C:\Users...\Desktop\apollo_kit\apollo-universal-starter-ki
t\node_modules@babel\runtime\helpers\typeof.js:1:263)
at _typeof (C:\Users...\Desktop\apollo_kit\apollo-universal-starter-kit
\node_modules@babel\runtime\helpers\typeof.js:4:39)
at Object. (C:\Users...\Desktop\apollo_kit\apollo-universal-
starter-kit\node_modules\core-js\modules\es6.symbol.js:67:54)
at Module._compile (module.js:652:30)
at Module._compile (C:\Users...\Desktop\apollo_kit\apollo-universal-sta
rter-kit\node_modules\pirates\lib\index.js:99:24)
at Module._extensions..js (module.js:663:10)
at Object.newLoader [as .js] (C:\Users...\Desktop\apollo_kit\apollo-uni
versal-starter-kit\node_modules\pirates\lib\index.js:104:7)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this co
mmand.

@larixer
Copy link
Member

larixer commented Jul 4, 2019

@drockyy Where did you find .spinrc.js file in master? Could you point me to this file on GitHub?

@drockyy
Copy link

drockyy commented Jul 4, 2019

@Vlasenko I have made a checkout on the master branch and there was a .sprinrc.js, after I pulled the branch again, the file disappeared. Okay I'm sorry, it was a locally issue of Git.

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