Skip to content
This repository has been archived by the owner on Feb 15, 2025. It is now read-only.
This repository has been archived by the owner on Feb 15, 2025. It is now read-only.

Out of the box react-component project fails test execution with "TypeError: Object is not a constructor" #570

Open
@itzg

Description

This issue is a:

  • Bug report

This issue is reproducible with the repository

https://github.com/itzg/try-nwb-react-component

however, it contains completely out of the box content from nwb new react-component other than the modified README.md

nwb is installed globally and the following transcript show how the npm run test fails with no modifications on my part.

> npm version
{
  npm: '7.12.0',
  node: '16.1.0',
  v8: '9.0.257.24-node.11',
  uv: '1.41.0',
  zlib: '1.2.11',
  brotli: '1.0.9',
  ares: '1.17.1',
  modules: '93',
  nghttp2: '1.42.0',
  napi: '8',
  llhttp: '6.0.1',
  openssl: '1.1.1k+quic',
  cldr: '39.0',
  icu: '69.1',
  tz: '2021a',
  unicode: '13.0',
  ngtcp2: '0.1.0-DEV',
  nghttp3: '0.1.0-DEV'
}

> nwb version
v0.25.2

> nwb new react-component try-nwb-react-component
Creating a react-component project...
? Do you want to create an ES modules build for use by compatible bundlers? Yes
? Do you want to create a UMD build for global usage via <script> tag? No
  create .gitignore
  create .travis.yml
  create CONTRIBUTING.md
  create README.md
  create demo\src\index.js
  create nwb.config.js
  create package.json
  create src\index.js
  create tests\.eslintrc
  create tests\index.test.js
... REMOVED NPM ACTIVITY ...


> cd try-nwb-react-component

> npm run test

> [email protected] test
> nwb test-react


START:
16 05 2021 10:01:49.363:INFO [karma-server]: Karma v5.0.9 server started at http://0.0.0.0:9876/
16 05 2021 10:01:49.366:INFO [launcher]: Launching browsers PhantomJS with concurrency unlimited
16 05 2021 10:01:49.437:INFO [launcher]: Starting browser PhantomJS
16 05 2021 10:01:59.800:INFO [PhantomJS 2.1.1 (Windows 8)]: Connected on socket k6ynVDimvC58zmVhAAAA with id 50452137
PhantomJS 2.1.1 (Windows 8) ERROR
  TypeError: Object is not a constructor (evaluating 'getPolyfill()')
  at webpack:///node_modules/reflect.getprototypeof/index.js:10:1 <- tests/index.test.js:35449:33

Finished in 0.459 secs / 0 secs @ 10:02:00 GMT-0500 (Central Daylight Time)

SUMMARY:
√ 0 tests completed
Karma exit code was 1

Added DEBUG=nwb and now it fails in a different way prior to karma invocation:

> npm run test

> [email protected] test
> nwb test-react

C:\Users\itzg\try-nwb-react-component\node_modules\debug\src\common.js:179
                                createDebug.names.push(new RegExp('^' + namespaces + '$'));
                                                       ^

SyntaxError: Invalid regular expression: /^[default:$/: Unterminated character class
    at new RegExp (<anonymous>)
    at Function.enable (C:\Users\itzg\try-nwb-react-component\node_modules\debug\src\common.js:179:28)
    at setup (C:\Users\itzg\try-nwb-react-component\node_modules\debug\src\common.js:261:14)
    at Object.<anonymous> (C:\Users\itzg\try-nwb-react-component\node_modules\debug\src\node.js:236:37)
    at Module._compile (node:internal/modules/cjs/loader:1109:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
    at Module.load (node:internal/modules/cjs/loader:989:32)
    at Function.Module._load (node:internal/modules/cjs/loader:829:14)
    at Module.require (node:internal/modules/cjs/loader:1013:19)
    at require (node:internal/modules/cjs/helpers:93:18)

This might be a duplicate of #496 ; however, that issue has gone dormant and this current is easily reproducible.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions