#Package subpath './tailwind' is not defined by

1 messages · Page 1 of 1 (latest)

fierce token
#

Error: Package subpath './tailwind' is not defined by "exports" in C:\Coding\fveri.com\frontend\node_modules\flowbite-react\package.json

#

Any ideas why i'm getting this error with flowbite-react

rotund needle
#

seems like there are some issues for windows machines, i need to investigate this

fierce token
#

well i still try to use the old tailwind 3 config but I guess it's obsolete now. (was working with 0.10.x)

rotund needle
#

oh I see, u haven't removed the old import

#

please check this

fierce token
#

okay will try it

#

one more question what does that patch command do added to postbuild?

rotund needle
#

it exposes the tailwind version in a .js file for maximum bundler compatibility, and allowing the library to work hybrid for both v3 and v4

#

we're not modifying the tailwindcss library or behaviour in any way, we're just exposing the version better

#

this work is only done because we want to support both Tailwind CSS v3 and v4

#

if in the future we'll drop hybrid support, this command will fade away

fierce token
#

okay i followed all the instructions and migration is all good now

#

except when I build my next.js project (after only flowbite--react 0.11.x upgrade) i get the following error

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './version.js' is not defined by "exports" in /home/runner/work/wowtrack.gg/wowtrack.gg/frontend/node_modules/tailwindcss/package.json

i'm not sure if this is related to tailwind or flowbite-react

#

after a fresh install (by removing all node_modules) getting this strange error: Could not resolve Tailwind CSS module path. Skipping version patch.

rotund needle
#

The error is because the flowbite-react patch was not done (or successful), i’ll have to check for the last error

#

Are u on windows?

#

And one what package manager are u using? (Eg: npm, yarn, pnpm, bun)

fierce token
#

yes on windows and using npm

rotund needle
#

pushed a fix now, could u try again? make sure to init the @latest version (0.11.7)

#

npx flowbite-react@latest init or npx flowbite-react@latest patch

fierce token
#

okay will check it again

#

still getting the error but the thing is that im not getting this error in windows now but github ci

#

windows part seems be okay

#
> npm run lint --prefix common && npm run lint --prefix frontend


> [email protected] lint
> npm install && eslint


> [email protected] postinstall
> cd .. && npx husky common/.husky


up to date, audited 560 packages in 2s

161 packages are looking for funding
  run `npm fund` for details

1 moderate severity vulnerability

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

> [email protected] lint
> next lint

node:internal/modules/esm/resolve:314
  return new ERR_PACKAGE_PATH_NOT_EXPORTED(
         ^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './version.js' is not defined by "exports" in /home/runner/work/fveri.com/fveri.com/frontend/node_modules/tailwindcss/package.json
    at exportsNotFound (node:internal/modules/esm/resolve:314:10)
    at packageExportsResolve (node:internal/modules/esm/resolve:661:9)
    at resolveExports (node:internal/modules/cjs/loader:639:36)
    at Function._findPath (node:internal/modules/cjs/loader:728:31)
    at Function.<anonymous> (node:internal/modules/cjs/loader:1211:27)
    at /home/runner/work/fveri.com/fveri.com/frontend/node_modules/next/dist/server/require-hook.js:55:36
    at Function._load (node:internal/modules/cjs/loader:1055:27)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:220:24)
    at Module.<anonymous> (node:internal/modules/cjs/loader:1311:12) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}```
#

also on windows i now got this error after upgrading to 0.11.7

#

Done Could not resolve Tailwind CSS module path. Skipping version patch.

#

tried a fresh install on windows

#
λ rm -fr node_modules\

E:\source\wowtrack.gg\frontend (feature/flowbite-react-0.11 -> origin)
λ npm install
npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported

> [email protected] postinstall
> cd .. && npx husky frontend/.husky && flowbite-react patch

Could not resolve Tailwind CSS module path. Skipping version patch.```
rotund needle
fierce token
#

if the error message instead included the exception, we would have more info

rotund needle
#

I know where its failing, I just need to find a workaround

fierce token
#

i can help you with testing the workarounds etc if needed

rotund needle
#

Yes please, that would be very awesome of u

runic lynx
rotund needle
runic lynx
#

i am using it through WSL2 so it's a linux machine really in heart

rotund needle
#

Still Windows at core

#

Also, creating that file urself would be redundant because the next time u run npm i it will get wiped

#

Thats why it needs patching on postinstall script

fierce token
#

any updates?

rotund needle
#

Working on it, trying different approaches that do not include patching any node module

#

But rather update ur local code with the correct config values based on installed tailwindcss version

rotund needle
fierce token
#

yep

rotund needle
rotund needle
#

Also, remove the postinstall flowbite-react patch script from package.json file

fierce token
#

okay ill try

fierce token
#

didn't understand the last step

rotund needle
fierce token
#

okay just tested in a new branch

#

it seems all good now and error seems to be gone

#

to make sure i'll clean all my node-modules and .next cache

#

and retry

#

also my github ci is building it to see if everything is okay

#

ye it seems all good

rotund needle
#

Good

fierce token
#

i should expect this to get included in next minor release?

rotund needle
#

Yes

#

(Or patch)

fierce token
#

any ETA on this?

fierce token
#

still looking for the release with the fix

rotund needle
#

It's gonna be out soon

#

I'm still struggling with the migration scripts, its really hard to make them work for all supported Frameworks and bundlers

#

I can push it now/today, but then the release changelogs will have a "Breaking changes" section, because of no automatic migration

fierce token
#

is this included in 0.11.8?

#

checked the logs

#

did i miss it?

rotund needle
#

It will be a minor release, so 0.12.0

fierce token
#

yo

fierce token
#

okay i guess this will never get fixed and i have to use a patched version. i don't understand why windows builds are not deserving a fix.

#

nearly 3 months since reported

rotund needle
#

It is not about windows, but rather Yarn PnP

#

I’ll resume work on this issue as soon as I get some free time on my hands

rotund needle
rotund needle
#

it's done.