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

fix: Can't render pages on older versions of Nuxt if options.watch is missing #52

Merged

Conversation

arikw
Copy link
Contributor

@arikw arikw commented Dec 14, 2020

If nuxt.config.js doesn't contain a watch property, Nuxt v1.4.2 fails to render a page with a TypeError: Cannot read property 'push' of undefined error.

This PR adds an empty watch array to the options as a fallback to fix the issue.

Tested on Nuxt v1.4.2 and v2.14.6

Tested on Nuxt v1.4.2 and v2.14.6
@arikw arikw marked this pull request as ready for review December 14, 2020 17:39
@arikw arikw changed the title Fixed support for older versions of Nuxt Fixed support for older versions of Nuxt. Ready for merge Dec 14, 2020
@arikw arikw changed the title Fixed support for older versions of Nuxt. Ready for merge Fixed support for older versions of Nuxt. Ready to be merged Dec 14, 2020
@codecov
Copy link

codecov bot commented Dec 14, 2020

Codecov Report

Merging #52 (d896be4) into master (3e53050) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #52   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         3           
  Lines           22        23    +1     
  Branches         2         3    +1     
=========================================
+ Hits            22        23    +1     
Impacted Files Coverage Δ
lib/module.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3e53050...d896be4. Read the comment docs.

@arikw arikw changed the title Fixed support for older versions of Nuxt. Ready to be merged Fixed support for older versions of Nuxt Dec 14, 2020
@arikw arikw changed the title Fixed support for older versions of Nuxt Fix: Can't render pages on older versions of Nuxt if options.watch is missing Dec 14, 2020
@arikw arikw changed the title Fix: Can't render pages on older versions of Nuxt if options.watch is missing fix: Can't render pages on older versions of Nuxt if options.watch is missing Dec 14, 2020
@ricardogobbosouza
Copy link
Collaborator

@arikw thanks

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

Successfully merging this pull request may close these issues.

2 participants