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

Build app is not loading stories - "Cannot read properties of undefined (reading 'find')" #759

Open
6 tasks done
falko-apheris opened this issue Sep 5, 2024 · 1 comment
Labels
to triage This issue needs to be triaged

Comments

@falko-apheris
Copy link

Describe the bug

I'm using the latest version of histoire with nuxt.

In histoire dev mode everything works ok, but the build app it does not work. I can load the UI just fine, but when I try to click on a story I get the following error in bundle-sandbox-BYbFb-tO.js

Uncaught TypeError: Cannot read properties of undefined (reading 'find')

When I inspect the file all imported name are undefined

import { m as mapFile, f as files, _ as _sfc_main, h as histoireConfig, i as isDark } from "./GenericMountStory.vue2-D3-GW49k.js";

I inspected GenericMountStory.vue2-D3-GW49k.js and it looks ok. The files are there.

I can see that all exported names are set in a promise then. I added a log statement in the then function and I can see that the then resolves after the import, thus the undefined imports.

Reproduction

I currently do not have a reproduction

System Info

System:
    OS: Linux 6.8 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
    CPU: (8) x64 Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
    Memory: 2.46 GB / 15.30 GB
    Container: Yes
    Shell: 5.8.1 - /usr/bin/zsh
  Binaries:
    Node: 20.17.0 - ~/.nvm/versions/node/v20.17.0/bin/node
    Yarn: 1.22.19 - ~/.npm-global/bin/yarn
    npm: 10.8.2 - ~/.nvm/versions/node/v20.17.0/bin/npm
    pnpm: 9.9.0 - ~/.local/share/pnpm/pnpm
  Browsers:
    Chrome: 128.0.6613.119
    Chromium: 128.0.6613.113
  npmPackages:
    @histoire/plugin-nuxt: ^0.17.17 => 0.17.17
    histoire: ^0.17.17 => 0.17.17

Used Package Manager

pnpm

Validations

@falko-apheris falko-apheris added the to triage This issue needs to be triaged label Sep 5, 2024
@falko-apheris
Copy link
Author

Further inspection of GenericMountStory.vue2-D3-GW49k.js shows me that in the then function there is no await used. I removed the then wrap around the code and everything is loading again.

let __tla = Promise.all([
  (() => {
    try {
      return __tla_0;
    } catch {
    }
  })()
]).then(async () => {
// no await is used in here! Removing the then around this code fixes the issue.
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
to triage This issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

1 participant