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

📚[DOCS]: Issue Setting Up @ngxs/store Locally #2300

Open
XavierDupessey opened this issue Feb 10, 2025 · 3 comments
Open

📚[DOCS]: Issue Setting Up @ngxs/store Locally #2300

XavierDupessey opened this issue Feb 10, 2025 · 3 comments

Comments

@XavierDupessey
Copy link

Hello,

I’d like to contribute a new feature to @ngxs/store, so I cloned the repository and started setting it up locally to implement the changes.

However, I’m stuck on the installation step. I followed the instructions in the README and ran yarn build:packages. Unfortunately, this command throws an error related to astro:

$ yarn build:packages
yarn run v1.22.22
$ yarn nx run-many --target=build --all && ts-node tools/set-metadata
$ nx run-many --target=build --all

   √  nx run store:build-package (9s)
   √  nx run store:build (4s)
   √  nx run router-plugin:build (8s)
   √  nx run storage-plugin:build-package (4s)
   √  nx run websocket-plugin:build (3s)
   √  nx run devtools-plugin:build (3s)
   √  nx run logger-plugin:build (3s)
   √  nx run form-plugin:build (3s)
   √  nx run hmr-plugin:build (3s)
   √  nx run storage-plugin:build (2s)

————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 
   ×  nx run create-app:build
warning package.json: No license field
$ astro build
      'astro' is not recognized as an internal or external command,
      operable program or batch file.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
      error Command failed with exit code 1.

I tried installing astro globally, but then encountered another error:

$ yarn build:packages
yarn run v1.22.22
$ yarn nx run-many --target=build --all && ts-node tools/set-metadata
$ nx run-many --target=build --all

   √  nx run store:build-package  [local cache]
   √  nx run store:build  [local cache]
   √  nx run router-plugin:build  [existing outputs match the cache, left as is]
   √  nx run storage-plugin:build-package  [local cache]                                                                                                                                                                      
   √  nx run websocket-plugin:build  [existing outputs match the cache, left as is]                                                                                                                                           
   √  nx run devtools-plugin:build  [existing outputs match the cache, left as is]
   √  nx run logger-plugin:build  [existing outputs match the cache, left as is]
   √  nx run form-plugin:build  [existing outputs match the cache, left as is]                                                                                                                                                
   √  nx run hmr-plugin:build  [existing outputs match the cache, left as is]                                                                                                                                                 
   √  nx run storage-plugin:build  [existing outputs match the cache, left as is]

————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 
   ×  nx run create-app:build
warning package.json: No license field
$ astro build
      ▶ Astro collects anonymous usage data.
        This information helps us improve Astro.
        Run "astro telemetry disable" to opt-out.
        https://astro.build/telemetry

      4:25:38 PM [vite] Error when evaluating SSR module C:\src\xdu-ngxs-store\tutorials\create-app\astro.config.ts: failed to import "@tutorialkit/astro"
      |- Error: Cannot find module '@tutorialkit/astro' imported from 'C:/src/xdu-ngxs-store/tutorials/create-app/astro.config.ts'
          at nodeImport (file:///c:/dev/devtools/nvm/v20.17.0/node_modules/astro/node_modules/vite/dist/node/chunks/dep-CHZK6zbr.js:53049:19)
          at ssrImport (file:///c:/dev/devtools/nvm/v20.17.0/node_modules/astro/node_modules/vite/dist/node/chunks/dep-CHZK6zbr.js:52916:22)
          at eval (C:/src/xdu-ngxs-store/tutorials/create-app/astro.config.ts:3:50)
          at instantiateModule (file:///c:/dev/devtools/nvm/v20.17.0/node_modules/astro/node_modules/vite/dist/node/chunks/dep-CHZK6zbr.js:52974:11)

      4:25:38 PM [vite] Pre-transform error: Failed to load url @tutorialkit/astro (resolved id: @tutorialkit/astro) in C:/src/xdu-ngxs-store/tutorials/create-app/astro.config.ts. Does the file exist?
      [astro] Unable to load your Astro config

      Cannot find module '@tutorialkit/astro' imported from 'C:/src/xdu-ngxs-store/tutorials/create-app/astro.config.ts'
        Stack trace:
          at nodeImport (file:///c:/dev/devtools/nvm/v20.17.0/node_modules/astro/node_modules/vite/dist/node/chunks/dep-CHZK6zbr.js:53049:19)
          at eval (C:/src/xdu-ngxs-store/tutorials/create-app/astro.config.ts:3:50)
error Command failed with exit code 1.
      info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I'm using Node v20.17.0 and Yarn 1.22.22 on Windows.

Did I miss a setup step? Any advice would be appreciated.

Thanks,
Xavier

@arturovt
Copy link
Member

Go to tutorials/create-app and run yarn there. We'll set it up its installation a bit later.

@markwhitfeld
Copy link
Member

@XavierDupessey hopefully you are able to come right with Artur's advice.
If it does work, please be encouraged to contribute a PR with corrected readme instructions as you would like to have seen them when getting started.

PS. If you would like to chat with me about the new feature that you would like to add, before commencing with the PR, please feel free to reach out to me on the NGXS Discord server.

@nikosanif
Copy link

If it does work, please be encouraged to contribute a PR with corrected readme instructions as you would like to have seen them when getting started.

Hi @markwhitfeld ,

I’d be happy to contribute a PR to improve the README instructions. I just need a bit of additional input to ensure accuracy:

  1. Regarding @ngxs/store, are the current instructions fully updated? I’m encountering an issue when running yarn start.
  • Node version: 22.12.0, Yarn version: 1.22.22
  • Error below 👇 (also tried with yarn start -- --skip-nx-cache)
  1. For adding a new package like @ngxs/<my-super-plugin>, are the existing guidelines up to date?

I appreciate your guidance and look forward to contributing.

Thanks in advance!

Image

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

No branches or pull requests

4 participants