dub icon indicating copy to clipboard operation
dub copied to clipboard

Local development setup error on Windows - Cannot find module '@dub/utils'

Open RanNahmany opened this issue 1 year ago • 17 comments

Hi there,

I'm trying to set up a local development environment for Dub on Windows 11

No matter what I do (pnpm i , pnpm build ,pnpm dev), I'm getting an error messages for '@dub/utils' and '@dub/ui': Cannot find module '@dub/utils' or its corresponding type declarations.ts(2307) and Module not found: Can't resolve '@dub/ui'

also, It seems like tsup is having troubles, with not being found

error screenshots: image image

The @dub packages are exist in node_modules: image

It would be much appreciated if someone could help me with this one 🙏

RanNahmany avatar Feb 12 '24 00:02 RanNahmany

@versecafe Maybe you're the one who can help

RanNahmany avatar Feb 12 '24 00:02 RanNahmany

@RanNahmany Let me spin up a windows VM to give it a test and see if it is windows having some odd behaviour with pnpm symlinking

versecafe avatar Feb 12 '24 15:02 versecafe

image getting build errors for dub/ui I am getting this error in ubuntu @RanNahmany @versecafe can someone guide me?

DeepakChowdary6 avatar Feb 12 '24 15:02 DeepakChowdary6

@RanNahmany @DeepakChowdary6 Can confirm on windows 11 and 10 pnpm linking for internal packages @dub/ui & @dub/utils are broken, I'm actively looking into this but it is a windows specific issue, using WSL is a temporary work around.

versecafe avatar Feb 12 '24 16:02 versecafe

image I am using WSL only still getting build errors

DeepakChowdary6 avatar Feb 12 '24 16:02 DeepakChowdary6

@DeepakChowdary6 that seems to be a completely different issue, are you sure your WSL environment is up to date for all node dependencies? and not ahead of the current version in the package.json as it may be deprecated

versecafe avatar Feb 12 '24 16:02 versecafe

@DeepakChowdary6 also try clearing the packages/**/dist directories and rebuild as they can add up to some weird conflicts if you keep old outputs across different git versions as it is untracked

versecafe avatar Feb 12 '24 16:02 versecafe

image ISPSAMLConfig was not present in the package "@boxyhq/saml-jackson"

I tried clearing dist folders and even clearing node modules also to rebuild ,still it's not working

image

I installed all the dependencies again is this issue common ?with peer dependencies

DeepakChowdary6 avatar Feb 12 '24 16:02 DeepakChowdary6

image ISPSAMLConfig was not present in the package "@boxyhq/saml-jackson"

I tried clearing dist folders and even clearing node modules also to rebuild ,still it's not working

image

I installed all the dependencies again is this issue common ?with peer dependencies

Make sure you're on the correct version as it does exist and is exported, in their repo under npm/src/typings.ts

versecafe avatar Feb 12 '24 18:02 versecafe

@RanNahmany just do this,

  • delete all the node_modules
  • go to packages/ui and run pnpm pack it will generate a .tgz file ignore that for now
  • do this for all the packages in the packages folder
  • hit pnpm install from the root
  • delete all the .tgz file previously generated by step 2

I have the similar issue, but after doing this this error was gone.

Aashish-Upadhyay-101 avatar Feb 15 '24 06:02 Aashish-Upadhyay-101

@RanNahmany

The same thing happened to me.

Go to your packages/utils folder and run pnpm build manually

pierrefrota avatar Mar 02 '24 02:03 pierrefrota

It worked, thank you, @pierrefrota.

Vipul-7 avatar Mar 03 '24 05:03 Vipul-7

The same thing happened to me.

Go to your packages/utils folder and run pnpm build manually

it worked, but could you explain, why?

amishk783 avatar Mar 14 '24 12:03 amishk783

@amishk783 Likely that turbo on windows is not correctly recognizing the necessary dependency sequence which requires building packages/utils first

versecafe avatar Mar 14 '24 16:03 versecafe

I had to pnpm build both ui and utils manually for it to work. macOS Sonoma.

samiralibabic avatar Mar 29 '24 16:03 samiralibabic

@samiralibabic Thanks. It works on my macOS Sonoma now. Here what I did and the error went away.

  1. remove all node_module (root, app/web)
  2. pnpm build in packages/utils
  3. pnpm build packages/ui
  4. pnpm install from the root

AIOSYM avatar Apr 04 '24 12:04 AIOSYM

Thanks @AIOSYM and @samiralibabic

devkiran avatar Jul 03 '24 12:07 devkiran