question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot read property 'tap' of undefined

See original GitHub issue

Current Behavior

Running nx run app:serve provide following error (Failure Logs)

Expected Behavior

Open the app without errors or warnings Is this a regression? No

Steps to Reproduce

Here’s a Github repo And the following actions run

Steps,

  1. Create an nx workspace with react preset
  2. Add following package.json file { "dependencies": { "core-js": "^3.13.1", "document-register-element": "1.14.10", "gatsby": "^3.6.2", "gatsby-image": "3.6.0", "gatsby-plugin-manifest": "3.6.0", "gatsby-plugin-offline": "4.6.0", "gatsby-plugin-react-helmet": "4.6.0", "gatsby-plugin-sharp": "3.6.0", "gatsby-plugin-svgr": "3.0.0-beta.0", "gatsby-plugin-typescript": "3.6.0", "gatsby-source-filesystem": "3.6.0", "gatsby-transformer-sharp": "3.6.0", "next": "10.2.3", "prop-types": "15.7.2", "react": "17.0.2", "react-dom": "17.0.2", "react-helmet": "6.1.0", "regenerator-runtime": "0.13.7", "tslib": "^2.2.0" }, "devDependencies": { "@babel/core": "7.14.3", "@babel/preset-env": "7.14.4", "@babel/preset-react": "7.13.13", "@babel/preset-typescript": "7.13.0", "@emotion/babel-preset-css-prop": "11.2.0", "@nrwl/cli": "12.3.6", "@nrwl/cypress": "12.3.6", "@nrwl/eslint-plugin-nx": "12.3.6", "@nrwl/express": "^12.3.6", "@nrwl/gatsby": "^12.3.6", "@nrwl/jest": "12.3.6", "@nrwl/linter": "12.3.6", "@nrwl/next": "^12.3.6", "@nrwl/node": "12.3.6", "@nrwl/nx-cloud": "12.1.8", "@nrwl/react": "^12.3.6", "@nrwl/storybook": "^12.3.6", "@nrwl/tao": "12.3.6", "@nrwl/web": "^12.3.6", "@nrwl/workspace": "12.3.6", "@storybook/addon-knobs": "^6.2.9", "@storybook/react": "^6.2.9", "@svgr/webpack": "^5.5.0", "@testing-library/react": "11.2.7", "@types/jest": "26.0.23", "@types/node": "15.12.0", "@types/reach__router": "^1.3.8", "@types/react": "17.0.9", "@types/react-dom": "17.0.6", "@types/react-redux": "7.1.16", "@types/webpack": "5.28.0", "@typescript-eslint/eslint-plugin": "4.26.0", "@typescript-eslint/parser": "4.26.0", "babel-jest": "27.0.2", "babel-loader": "8.2.2", "babel-plugin-module-resolver": "4.1.0", "babel-preset-gatsby": "1.6.0", "cypress": "^7.4.0", "dotenv": "10.0.0", "eslint": "7.27.0", "eslint-config-prettier": "8.3.0", "eslint-plugin-cypress": "^2.11.3", "eslint-plugin-import": "2.23.4", "eslint-plugin-jsx-a11y": "6.4.1", "eslint-plugin-react": "7.24.0", "eslint-plugin-react-hooks": "4.2.0", "jest": "27.0.4", "prettier": "2.3.0", "ts-jest": "27.0.2", "ts-node": "~10.0.0", "tslint": "~6.1.3", "typescript": "~4.3.2", "url-loader": "^4.1.1" } }
  3. Install dependencies with yarn
  4. Run the app with serve

Failure Logs

`> nx run test:serve Starting type checking service… Using 1 worker with 2048MB memory limit Cannot read property ‘tap’ of undefined

———————————————————————————————————————————————

NX ERROR Running target “test:serve” failed

Failed tasks:

  • test:serve

Error: Process completed with exit code 1.`

Environment

Node : 14.17.0 OS : linux x64 yarn : 1.22.10

nx : Not Found @nrwl/angular : Not Found @nrwl/cli : 12.3.6 @nrwl/cypress : 12.3.6 @nrwl/devkit : 12.3.6 @nrwl/eslint-plugin-nx : 12.3.6 @nrwl/express : 12.3.6 @nrwl/jest : 12.3.6 @nrwl/linter : 12.3.6 @nrwl/nest : Not Found @nrwl/next : 12.3.6 @nrwl/node : 12.3.6 @nrwl/react : 12.3.6 @nrwl/schematics : Not Found @nrwl/tao : 12.3.6 @nrwl/web : 12.3.6 @nrwl/workspace : 12.3.6 @nrwl/storybook : 12.3.6 @nrwl/gatsby : 12.3.6 typescript : 4.3.2

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:19 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
xiongemicommented, Aug 6, 2021

@Himadu2000 i submit a pr to your repo. so basically to have react and gatsby in the same nx workspace, you need to have webpack 5. this is what I did:

  • run nx migrate latest to install the latest nx packages
  • run npx nx g @nrwl/web:webpack5 to upgrade to webpack 5
  • then I added a gatsby app just to test
0reactions
jaysoocommented, Jan 20, 2022

Closing this issue since we’ve moved Gatsby plugin to the labs repo. https://github.com/nrwl/nx-labs

Feel free to open it there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Cannot read property 'tap' of undefined #5781
I need to install webpack for react-styleguidist, but it seems if the version doesn't match the one Next is using this error occurs....
Read more >
ProgressPlugin TypeError: Cannot read property 'tap' of ...
In my case the error was that I put a plugin under resolve.plugins , instead of directly in plugins inside the webpack config....
Read more >
Cannot read property 'tap' of undefined in ts-loader #14157
Describe the bug. Module build failed (from ./node_modules/ts-loader/index.js): TypeError: Cannot read property 'tap' of undefined. To Reproduce ...
Read more >
TypeError: Cannot read property 'tap' of undefined - 掘金
执行打包操作时报错;原因:html-webpack-plugin 插件版本安装不兼容解决方法: 安装html-webpack-plugin 版本为4.5.0.
Read more >
Webpack: Cannot read property 'tap' of undefined-Reactjs
[Solved]-React- Webpack: Cannot read property 'tap' of undefined-Reactjs ... I had the same exact problem. You have to add @babel/preset-react library to your ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found