solana-developers / create-solana-dapp

CLI for creating Solana dApps on the fly
https://npmjs.com/package/create-solana-dapp
MIT License
343 stars 106 forks source link

NX Cannot find module '@swc/types' #79

Closed metasal1 closed 1 month ago

metasal1 commented 3 months ago

When running nx build web

The error is NX Cannot find module '@swc/types'

This might be setup or inexperience with NX

FYI - nx serve web works fine

beeman commented 3 months ago

Hi there @metasal1 - could you try this again with version 3.0.5 I just promoted to latest?

If that doesn't work, would you mind sharing the output from the commands and the repo it generated so I can investigate? Cheers!

(base) [beeman@bee.local] solana-local $ pnpx create-solana-dapp@latest "test-swc"
 WARN  3 deprecated subdependencies found: glob@7.2.3, inflight@1.0.6, rimraf@3.0.2
Packages: +131
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 140, reused 131, downloaded 0, added 131, done
Library/Caches/pnpm/dlx/ltc4cak3zirodydd4s7u2fveny/190df6120c1-394e/node_modules/.pnpm/nx@19.0.0/node_modules/nx: RuLibrary/Caches/pnpm/dlx/ltc4cak3zirodydd4s7u2fveny/190df6120c1-394e/node_modules/.pnpm/nx@19.0.0/node_modules/nx: Running postinstall script, done in 419ms
┌  create-solana-dapp 3.0.5
│
◆  Project name: test-swc
│
◇  Select a preset
│  Next.js
│
◇  Select a UI library
│  Tailwind
│
◇  Select an Anchor template
│  Anchor Counter program with tests
│
◆  Anchor program name: test-swc
│
◇  Successfully created workspace with pnpm.
│
◇  Successfully installed preset @solana-developers/preset-next@3.0.5.
│
◇  Installation successful! ─────────────────────────────────────╮
│                                                                │
│  That's it!                                                    │
│                                                                │
│  Change to your new directory and start developing:            │
│                                                                │
│  cd ./test-swc                                                 │
│                                                                │
│  Start the Next.js app:                                        │
│                                                                │
│  pnpm run dev                                                  │
│                                                                │
│  Run Anchor commands:                                          │
│                                                                │
│  pnpm run anchor build | test | localnet | deploy              │
│                                                                │
│  Generate more features using the following command:           │
│                                                                │
│  pnpm run feature                                              │
│                                                                │
│  Found Anchor version 0.30.1. Expected Anchor version 0.30.0.  │
│                                                                │
│  https://www.anchor-lang.com/release-notes/0.30.0              │
│                                                                │
├────────────────────────────────────────────────────────────────╯
│
└  Good luck with your project!

(base) [beeman@bee.local] solana-local $ cd test-swc
(base) [beeman@bee.local] test-swc (main) $ pnpm nx build web

   ✔  1/1 dependent project tasks succeeded [0 read from cache]

   Hint: you can run the command with --verbose to see the full dependent project outputs

———————————————————————————————————————————————————————————————————————————————————————————————————————————————————

> nx run web:build:production

   ▲ Next.js 14.0.4

🌼   daisyUI 4.11.1
├─ ✔︎ 2 themes added        https://daisyui.com/docs/themes
╰─ ❤︎ Support daisyUI project:  https://opencollective.com/daisyui

 ✓ Creating an optimized production build
 ✓ Compiled successfully
   Skipping linting
 ✓ Checking validity of types
 ✓ Collecting page data
   Generating static pages (0/8)  [=   ]bigint: Failed to load bindings, pure JS will be used (try npm run rebuild?)
bigint: Failed to load bindings, pure JS will be used (try npm run rebuild?)
bigint: Failed to load bindings, pure JS will be used (try npm run rebuild?)
bigint: Failed to load bindings, pure JS will be used (try npm run rebuild?)
bigint: Failed to load bindings, pure JS will be used (try npm run rebuild?)
 ✓ Generating static pages (8/8)
 ✓ Collecting build traces
 ✓ Finalizing page optimization

Route (app)                              Size     First Load JS
┌ ○ /                                    613 B           249 kB
├ ○ /_not-found                          869 B          82.9 kB
├ ○ /account                             1.35 kB         229 kB
├ λ /account/[address]                   559 B           249 kB
├ ○ /api/hello                           0 B                0 B
├ ○ /clusters                            452 B           249 kB
└ ○ /test-swc                            2.39 kB         251 kB
+ First Load JS shared by all            82.1 kB
  ├ chunks/771-2ce65bc9d22348e2.js       26.7 kB
  ├ chunks/9fbbc2ce-23a1d89630bc4ddb.js  53.3 kB
  ├ chunks/main-app-245333a16b7443df.js  216 B
  └ chunks/webpack-16f47013c1a91d94.js   1.86 kB

○  (Static)   prerendered as static content
λ  (Dynamic)  server-rendered on demand using Node.js

———————————————————————————————————————————————————————————————————————————————————————————————————————————————————

 NX   Successfully ran target build for project web and 1 task it depends on (16s)
beeman commented 1 month ago

Gm! Yesterday we announced a new version of this cli which should fix this issue. Please give it a spin and comment here if the issue persists so I can investigate.