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

Live reload fails when adding scripts to project.json #8230

Closed
adornala opened this issue Dec 19, 2021 · 2 comments · Fixed by adornala/nx#1 or #8231
Closed

Live reload fails when adding scripts to project.json #8230

adornala opened this issue Dec 19, 2021 · 2 comments · Fixed by adornala/nx#1 or #8231

Comments

@adornala
Copy link
Contributor

Current Behavior

nrwl workspace: ^13.3.9

Getting node error:

(node:65678) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'get' of undefined at ScriptsWebpackPlugin.shouldSkip (/Users/dornaa01/IdeaProjects/botw-lib/node_modules/@nrwl/web/src/utils/webpack/plugins/scripts-webpack-plugin.js:29:59)

when running nx serve with scripts added in projects.json -> targets > build > options > scripts

Expected Behavior

Safely revive webpack from failing when user makes changes in code. (Live reload shouldn't fail)

Steps to Reproduce

Add jQuery to scripts for any project's projects.json -> targets > build > options > scripts

Failure Logs

(node:65678) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'get' of undefined
at ScriptsWebpackPlugin.shouldSkip (/Users/dornaa01/IdeaProjects/botw-lib/node_modules/@nrwl/web/src/utils/webpack/plugins/scripts-webpack-plugin.js:29:59)
at /Users/dornaa01/IdeaProjects/botw-lib/node_modules/@nrwl/web/src/utils/webpack/plugins/scripts-webpack-plugin.js:58:22
at /Users/dornaa01/IdeaProjects/botw-lib/node_modules/@nrwl/web/src/utils/webpack/plugins/scripts-webpack-plugin.js:16:93
at /Users/dornaa01/IdeaProjects/botw-lib/node_modules/webpack/lib/Compilation.js:591:47
at fn (/Users/dornaa01/IdeaProjects/botw-lib/node_modules/webpack/lib/Compilation.js:507:9)
at _next0 (eval at create (/Users/dornaa01/IdeaProjects/botw-lib/node_modules/tapable/lib/HookCodeFactory.js:33:10), :45:1)
at eval (eval at create (/Users/dornaa01/IdeaProjects/botw-lib/node_modules/tapable/lib/HookCodeFactory.js:33:10), :58:1)
at eval (eval at create (/Users/dornaa01/IdeaProjects/botw-lib/node_modules/tapable/lib/HookCodeFactory.js:33:10), :11:1)
at /Users/dornaa01/IdeaProjects/botw-lib/node_modules/webpack/lib/Compilation.js:500:10
at Hook.eval [as callAsync] (eval at create (/Users/dornaa01/IdeaProjects/botw-lib/node_modules/tapable/lib/HookCodeFactory.js:33:10), :7:1)
(node:65678) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 33)
(node:65678) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Environment

Local environment

@adornala
Copy link
Contributor Author

Temporary fix to get this resolved:

Open node_modules/@nrwl/web/src/utils/webpack/plugins/scripts-webpack-plugin.js:29:59 and add null check on fileTimestamps

Screen Shot 2021-12-19 at 2 25 31 AM

Temporary fix: I have a note to make sure when ever I do an npm install I need to make above change.

adornala added a commit to adornala/nx that referenced this issue Dec 19, 2021
feat(npm): resolved issue with live reload failing

Fixed the issue with live reload when adding scripts in project.json

Closes nrwl#8230
FrozenPandaz pushed a commit that referenced this issue Mar 18, 2022
feat(npm): resolved issue with live reload failing

Fixed the issue with live reload when adding scripts in project.json

Closes #8230
philipjfulcher added a commit that referenced this issue Mar 31, 2022
* feat(dep-graph): add dark mode

Squashed commits:

feat(dep-graph): Updating tailwind config file.

As of version 3.0 higher tailwind jit mode is default. Instead of purge is now content and as dark mode will be added as class.

feat(dep-graph): Enabling toggable dark mode.

As darkmode (tailwind.congig.json) is set as class, we need to add the script to the head tag on index.html.
see: https://tailwindcss.com/docs/dark-mode

feat(dep-graph): Adding theme Initializer and creating support functions

All functions related to theme changing and initialization are located on the theme-resolver.tsx
The themeInit function will run when page is loaded and apply add class to the <html> tag as dark or light accordignly. Theme resolver applies the changes and keeps localstorage and <html class> in sync.

feat(dep-graph): Adding theme panel

The pannel allows users to switch themes. Currently it only changes the html class and localstorage.

feat(dep-graph): Creating tailwind dark colors pallete

The current colors remain as light. The dark colors are an attempt to contrast the light ones.

feat(dep-graph): Adding additional styles to sidebar

feat(dep-graph): Define styling presets for darkmode to allow consistent and concise classNames.

feat(dep-graph): Apply dark styling classes to sidebar

feat(dep-graph): Added dark mode styles to the debugger

feat(dep-graph): Added Color to tailwind config and adjusting imports.

feat(dep-graph): Created theme tracker

feat(dep-graph): Added dark classes to graph container

feat(dep-graph): Adjusted some edge styles for better UX. Added dynamic selection of colors according to the current theme.

feat(dep-graph):  Added transition when switching themes.

feat(dep-graph): Readded auto roation for implicit label and dynamic background.

feat(dep-graph): Assigned generic types to selectDynbamically, and added new color to the pallete.

feat(dep-graph): Added dynamic styles for theming.

feat(dep-graph): Added mock for matchMedia. Tests will fail otherwise.

feat(dep-graph): Added styles to tippy.

feat(dep-graph): Moved theme related functions to theme-resolver file

feat(dep-graph): Implement dark mode on tooltips.

feat(dep-graph): re-evaluate graph colors on theme change

cleanup(dep-graph): Removed duplicate style

chore(dep-graph): Testing theme preferences

Adding test cases for theme initialization, and the ability to change.

cleanup(dep-graph): removing repeated style classes

Fixed issue with webpack plugin (#8231)

feat(npm): resolved issue with live reload failing

Fixed the issue with live reload when adding scripts in project.json

Closes #8230

chore(repo): update nx to 13.10.0-beta.1 (#9407)

feat(dep-graph): re-evaluate graph colors on theme change

fix(dep-graph): use theme background color in image download

* fix(dep-graph): change dark mode styles

* cleanup(dep-graph): cleanup e2e tests and naming

Co-authored-by: Philip Fulcher <philip@nrwl.io>
sidmonta pushed a commit to sidmonta/nx that referenced this issue Apr 2, 2022
* feat(dep-graph): add dark mode

Squashed commits:

feat(dep-graph): Updating tailwind config file.

As of version 3.0 higher tailwind jit mode is default. Instead of purge is now content and as dark mode will be added as class.

feat(dep-graph): Enabling toggable dark mode.

As darkmode (tailwind.congig.json) is set as class, we need to add the script to the head tag on index.html.
see: https://tailwindcss.com/docs/dark-mode

feat(dep-graph): Adding theme Initializer and creating support functions

All functions related to theme changing and initialization are located on the theme-resolver.tsx
The themeInit function will run when page is loaded and apply add class to the <html> tag as dark or light accordignly. Theme resolver applies the changes and keeps localstorage and <html class> in sync.

feat(dep-graph): Adding theme panel

The pannel allows users to switch themes. Currently it only changes the html class and localstorage.

feat(dep-graph): Creating tailwind dark colors pallete

The current colors remain as light. The dark colors are an attempt to contrast the light ones.

feat(dep-graph): Adding additional styles to sidebar

feat(dep-graph): Define styling presets for darkmode to allow consistent and concise classNames.

feat(dep-graph): Apply dark styling classes to sidebar

feat(dep-graph): Added dark mode styles to the debugger

feat(dep-graph): Added Color to tailwind config and adjusting imports.

feat(dep-graph): Created theme tracker

feat(dep-graph): Added dark classes to graph container

feat(dep-graph): Adjusted some edge styles for better UX. Added dynamic selection of colors according to the current theme.

feat(dep-graph):  Added transition when switching themes.

feat(dep-graph): Readded auto roation for implicit label and dynamic background.

feat(dep-graph): Assigned generic types to selectDynbamically, and added new color to the pallete.

feat(dep-graph): Added dynamic styles for theming.

feat(dep-graph): Added mock for matchMedia. Tests will fail otherwise.

feat(dep-graph): Added styles to tippy.

feat(dep-graph): Moved theme related functions to theme-resolver file

feat(dep-graph): Implement dark mode on tooltips.

feat(dep-graph): re-evaluate graph colors on theme change

cleanup(dep-graph): Removed duplicate style

chore(dep-graph): Testing theme preferences

Adding test cases for theme initialization, and the ability to change.

cleanup(dep-graph): removing repeated style classes

Fixed issue with webpack plugin (nrwl#8231)

feat(npm): resolved issue with live reload failing

Fixed the issue with live reload when adding scripts in project.json

Closes nrwl#8230

chore(repo): update nx to 13.10.0-beta.1 (nrwl#9407)

feat(dep-graph): re-evaluate graph colors on theme change

fix(dep-graph): use theme background color in image download

* fix(dep-graph): change dark mode styles

* cleanup(dep-graph): cleanup e2e tests and naming

Co-authored-by: Philip Fulcher <philip@nrwl.io>
@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant