Skip to content

fix: Cannot read property 'filter' of null on Zeit#95

Open
adesege wants to merge 1 commit into
nuxt-community:devfrom
adesege:fix-cannot-read-property-filter-of-null-on-zeit
Open

fix: Cannot read property 'filter' of null on Zeit#95
adesege wants to merge 1 commit into
nuxt-community:devfrom
adesege:fix-cannot-read-property-filter-of-null-on-zeit

Conversation

@adesege

@adesege adesege commented Dec 31, 2019

Copy link
Copy Markdown

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

@codecov

codecov Bot commented Dec 31, 2019

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (1a1b277) to head (ea35d72).
⚠️ Report is 14 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff            @@
##               dev       #95   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            7         7           
  Lines          261       261           
  Branches        57        58    +1     
=========================================
  Hits           261       261           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@NicoPennec

Copy link
Copy Markdown
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

adesege commented Jul 1, 2020

Copy link
Copy Markdown
Author

@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