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: Cannot read property 'filter' of null on Zeit #95

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

adesege
Copy link

@adesege adesege commented Dec 31, 2019

routes is null when using @nuxtjs/now-builder on Zeit. This fix sets an empty array when the variable null.

@codecov
Copy link

codecov bot commented Dec 31, 2019

Codecov Report

Merging #95 into dev will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##               dev       #95   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            7         7           
  Lines          261       261           
  Branches        57        58    +1     
=========================================
  Hits           261       261           
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 1a1b277...ea35d72. Read the comment docs.

@NicoPennec
Copy link
Member

Thanks for your patch @adesege 🙏
But It seems not fix the root cause. Why the globalCache.staticRoutes is empty here?

cache.staticRoutes = () => excludeRoutes(options.exclude, globalCache.staticRoutes)

I will investigate.

@TheAlexLichter TheAlexLichter self-requested a review May 27, 2020 08:50
@NicoPennec NicoPennec self-requested a review May 27, 2020 09:18
@adesege adesege force-pushed the fix-cannot-read-property-filter-of-null-on-zeit branch from 8a43d86 to ea35d72 Compare July 1, 2020 17:44
@adesege
Copy link
Author

adesege commented Jul 1, 2020

@NicoPennec globalCache.staticRoutes will hold static site routes and since the package can be used for both statically and universally generated sites, line 25 returns error if it can't find the sitemap-routes.json file in the dist folder.

I have updated line 26 to default to an empty array instead.

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.

3 participants