Skip to content

@nx/vue stories generator fails with: The "path" argument must be of type string #30955

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

Open
1 of 4 tasks
eduardoRoth opened this issue Apr 30, 2025 · 3 comments · May be fixed by #30956 or #31181
Open
1 of 4 tasks

@nx/vue stories generator fails with: The "path" argument must be of type string #30955

eduardoRoth opened this issue Apr 30, 2025 · 3 comments · May be fixed by #30956 or #31181

Comments

@eduardoRoth
Copy link

Current Behavior

When running nx g @nx/vue:stories --interactionTests=true an error occurs if a new story has to be created.

Expected Behavior

Stories should be created after running the generator.

GitHub Repo

No response

Steps to Reproduce

  1. Create a new Vue or Nuxt project
  2. Generate a new Vue library
  3. Configure the library with storybook-configuration generator
  4. Create a component in the Vue library
  5. Run the stories generator for the vue library

Nx Report

NX   Report complete - copy this into the issue template

Node           : 20.18.2
OS             : darwin-arm64
Native Target  : aarch64-macos
npm            : 11.3.0

nx (global)        : 20.8.1
nx                 : 20.8.1
@nx/js             : 20.8.1
@nx/eslint         : 20.8.1
@nx/workspace      : 20.8.1
@nx/cypress        : 20.8.1
@nx/devkit         : 20.8.1
@nx/eslint-plugin  : 20.8.1
@nx/nuxt           : 20.8.1
@nx/playwright     : 20.8.1
@nx/storybook      : 20.8.1
@nx/vite           : 20.8.1
@nx/vue            : 20.8.1
@nx/web            : 20.8.1
typescript         : 5.7.3
---------------------------------------
Registered Plugins:
@nx/js/typescript
@nx/eslint/plugin
@nx/vite/plugin
@nx/nuxt/plugin
@nx/playwright/plugin
@nx/storybook/plugin
---------------------------------------
Cache Usage: 484.00 B / 92.64 GB

Failure Logs

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
    at Object.join (node:path:1269:7)
    at joinPathFragments (***/node_modules/nx/src/utils/path.js:23:31)
    at createComponentStories (***/node_modules/@nx/vue/src/generators/stories/lib/component-story.js:14:62)
    at ***/node_modules/@nx/vue/src/generators/stories/stories.js:40:56
    at Array.map (<anonymous>)
    at createAllStories (***/node_modules/@nx/vue/src/generators/stories/stories.js:37:38)
    at storiesGenerator (***/node_modules/@nx/vue/src/generators/stories/stories.js:55:11)
    at ***/node_modules/nx/src/command-line/generate/generate.js:240:32
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async handleErrors (***/node_modules/nx/src/utils/handle-errors.js:8:24) {
  code: 'ERR_INVALID_ARG_TYPE'
}

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

@brpowell
Copy link

This issue is present for @nx/webpack as well

> storybook dev            
┃                                                                                                                                                           
┃  @storybook/core v8.6.12                                                                                                                                                    
┃                                                                                                                                                                             
┃  info => Starting manager..                                                                                                                                                 
┃  info => Starting preview..                                                                                                                                                 
┃  info Addon-docs: using MDX3                                                                                                                                                
┃  => Loading Nx React Storybook Addon from "@nx/react/plugins/storybook"                                                                                                     ┃
┃  => Failed to build the preview                                                                                                                                             
┃  TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined                                                                           ┃
┃      at Object.join (node:path:1175:7)                                                                                                                                      
┃      at createLoaderFromCompiler (/project/node_modules/@nx/webpack/src/plugins/nx-webpack-plugin/lib/compiler-loaders.js:59:31)
┃      at applyNxDependentConfig (/project/node_modules/@nx/webpack/src/plugins/nx-webpack-plugin/lib/apply-base-config.js:363:61)
┃      at applyBaseConfig (/project/node_modules/@nx/webpack/src/plugins/nx-webpack-plugin/lib/apply-base-config.js:41:5)         
┃      at configure (/project/node_modules/@nx/webpack/src/utils/with-nx.js:15:49)            
┃      at combined (/project/node_modules/@nx/webpack/src/utils/config.js:36:22)              
┃      at Object.webpack (/project/node_modules/@nx/react/plugins/storybook/index.js:143:25)  
┃      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
┃      at async starter (/project/node_modules/@storybook/builder-webpack5/dist/index.js:1:22249)               
┃      at async Module.start (/project/node_modules/@storybook/builder-webpack5/dist/index.js:1:26054)

@eduardoRoth eduardoRoth linked a pull request May 12, 2025 that will close this issue
@eduardoRoth
Copy link
Author

@brpowell the following PR should fix the error on webpack

@eduardoRoth
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants