cds-snc / resources-ressources

Learning Resources / Ressources d'apprentissage
MIT License
3 stars 1 forks source link

Local development not working as intended #243

Closed anikbrazeau closed 1 year ago

anikbrazeau commented 2 years ago

Describe the bug Navigating away from landing page on localhost:3000 gives an error:

ℹ Waiting for file changes                                                                                                                      12:44:14
ℹ Memory usage: 565 MB (RSS: 851 MB)                                                                                                            12:44:14
ℹ Listening on: http://localhost:3000/                                                                                                          12:44:14
-- en/index.vue | locale: en-CA                                                                                                                 12:44:17

 ERROR  Cannot read properties of undefined (reading 'includes')                                                                                12:44:21

  at asyncData (_topic.vue:145:0)
  at promisify (.nuxt/utils.js:314:0)
  at server.js:4513:82
  at Array.map (<anonymous>)
  at module.exports../.nuxt/server.js.__webpack_exports__.default (.nuxt/server.js:269:0)`

To Reproduce

  1. Set up locally
  2. In terminal: npm run dev
  3. On localhost:3000 and click on "Hiring"
  4. See error
  5. A different error appears when click "Français"

Expected behavior Topic > Resources, page loading content

Screenshots image

Screen Shot 2022-09-20 at 3 48 08 PM Screen Shot 2022-09-20 at 3 48 02 PM Screen Shot 2022-09-20 at 3 58 23 PM

Desktop (please complete the following information):

Additional context Daine and Anik have both tested locally, with similar result.

daine commented 1 year ago

This issue is caused by the locale not being properly set (only happens in dev environment). This code fixes this issue.