Dwlad90 / stylex-swc-plugin

Community NAPI-RS/SWC plugin for StyleX.
MIT License
49 stars 4 forks source link

Dependency issue with latest StyleX #23

Open BMCwebdev opened 2 months ago

BMCwebdev commented 2 months ago

I have that other long thread already going, thought I would keep this one separate. I am trying to set up a test repo for you for my other issue, but ran into an error while setting it up.

I took a copy of your demo: https://github.com/Dwlad90/nextjs-app-dir-stylex/tree/main

I uninstalled @stylexswc/nextjs-plugin and @stylexswc/swc-plugin.

I updated @stylexjs/stylex, @stylexjs/babel-plugin", @stylexjs/eslint-plugin, @stylexjs/nextjs-plugin all to 0.7.5

@stylexswc/swc-plugin re-installs no problems.

When I try to re-install @stylexswc/nextjs-plugin I get the following dependency error.

npm install @stylexswc/nextjs-plugin --save-dev 
npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: next-app-dir-test@0.1.0
npm error Found: @stylexjs/babel-plugin@0.7.5
npm error node_modules/@stylexjs/babel-plugin
npm error   dev @stylexjs/babel-plugin@"^0.7.5" from the root project
npm error
npm error Could not resolve dependency:
npm error peer @stylexjs/babel-plugin@"^0.6.1" from @stylexswc/nextjs-plugin@0.1.0
npm error node_modules/@stylexswc/nextjs-plugin
npm error   dev @stylexswc/nextjs-plugin@"*" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
Dwlad90 commented 2 months ago

Hi @BMCwebdev,

The demo app now working with the latest versions of @stylexjs/babel-plugin and @stylexswc/swc-plugin

Could you please check if the dependency issue has been fixed?

BMCwebdev commented 2 months ago

I closed the other issue I had open. Looks like you cleared up the dependency mismatch.

my issue now is that StyleX errors out saying that defineVars needs to be compiled. For some reason it is having problems with my tokens file, even though I am almost a copy of StyleX open props demo.

in any case the error I am getting with this plugin is the same that I get with the StyleX CLI tool.

I have a discussion with StyleX if you want to follow along: https://github.com/facebook/stylex/discussions/687#discussioncomment-10620989

Dwlad90 commented 2 months ago

Yes, I saw this discussion. If the bug is really present in both plugins, then I would prefer that the @stylexjs/babel-plugin will be fixed first to avoid divergence in the implementation of features.

However, I tried to run your example together with the @stylexswc/swc-plugin@0.2.2 plugin and everything compiled successfully after minor changes.

The only thing is that I was unable to install the @bmcwebdev/tokens dependency due to lack of access rights

npm ERR! code E401
npm ERR! 401 Unauthorized - GET https://npm.pkg.github.com/download/@bmcwebdev/tokens/0.0.1/663b5f8c360984b4d54bf96f4675d95f28dfce4e - authentication token not provided

so I cloned the token's repo and linked it to the app.

Also needed to add @stylexjs/stylex to the dependencies of @bmcwebdev/tokens. After these manipulations, the application launched successfully.

Here is a link to a fork of your example with my small changes: https://github.com/Dwlad90/CLIDemo

BMCwebdev commented 2 months ago

Wow, @Dwlad90 , thank you very much. You have helped me a lot. Your example above helped me realize something about my setup which I now know is why my builds are breaking.

Everything works when we use my token library that is in your demo. However, in my actual build, I have two files in the token library. Something about that setup breaks what StyleX must be expecting.

For example, if I import something from the package published by this repository, which is the one we are using in your demo, and has only one token file, everything works https://github.com/BMCwebdev/stylexAcmeNextTest/tree/main/packages/tokens

But, if I import something from the package published by this repository, which has 2 token files, I will get a defineVars error. https://github.com/BMCwebdev/stylexAcmeNextTest/tree/main/packages/tokens-double-different

There must be something about that setup (with two files) that is incorrect, but I'm not sure what StyleX doesn't like about it, or what the correct method should be.

But soooooo close now! Thank you again!

BMCwebdev commented 2 months ago

Oh, and sorry about the access rights for installing @bmcwebdev/tokens, I made the packages public, not sure why. Perhaps something about my company's restrictions, but that doesn't seem right.

Invited you to the package.

Dwlad90 commented 2 months ago

Glad I could help you.

I updated the demo repository. After I removed the CLI from the prebuild process and rename source folder to src, the app built successfully using "@bmcwebdev/tokens-double-different".

You can see the changes in this commit.

Regarding the installation permissions, I still get a 401 error.

Thanks for the feedback🙂

BMCwebdev commented 2 months ago

Ah, I was so excited to see this working. Thank you. However when I try to implement into my actual project my troubles take a new turn.

I will paste below the error I get in my console. The main thing it seems to be complaining about is the swc_core. I took the latest version of the demo you made, and I downgraded Next to ^14.2.4 (and associated packages) and React to ^18.3.1 so that it matched my project. The demo repo continues to work, so that doesn't appear to be the issue.

my next.config in the big project is nearly the same as the demo repo. Not sure what could be causing the issue. Perhaps something in here stands out to you? I will keep poking at it as well.

pnpm run dev

> frontdoor-ui@0.1.0 predev /Users/brian.mccarthy/Development/npo-hub
> echo skip

skip

> frontdoor-ui@0.1.0 dev /Users/brian.mccarthy/Development/npo-hub
> next dev

  ▲ Next.js 14.2.12
  - Local:        http://localhost:3000
  - Environments: .env.development
  - Experiments (use with caution):
    · swcPlugins

 ✓ Starting...
!!!GETTING WEBPACK CONFIG!!!
======================
Count: 1
Build ID: development
Server: true
Env: dev
!!!GETTING WEBPACK CONFIG!!!
======================
Count: 2
Build ID: development
Server: true
Env: dev
!!!GETTING WEBPACK CONFIG!!!
======================
Count: 3
Build ID: development
Server: false
Env: dev
 ✓ Ready in 1687ms
 ○ Compiling /middleware ...
thread '<unnamed>' panicked at src/transform/mod.rs:241:12:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread '' panicked at /Users/geist/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swc-0.273.24/src/plugin.rs:166:14:
failed to invoke plugin: failed to invoke plugin on 'Some("/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@bonterratech+stitch-extension@0.0.1_@bonterratech+stitch-tokens@0.0.15_@stylexjs+stylex@0.7._2zynpcwalujtmrkgy6ggfwv6vi/node_modules/@bonterratech/stitch-extension/dist/stitch-extension.es.js")'

Caused by:
    0: failed to invoke `/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@stylexswc+swc-plugin@0.2.2/node_modules/@stylexswc/swc-plugin/dist/stylex_swc_plugin.wasm` as js transform plugin at /Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@stylexswc+swc-plugin@0.2.2/node_modules/@stylexswc/swc-plugin/dist/stylex_swc_plugin.wasm
    1: failed to run Wasm plugin transform. Please ensure the version of `swc_core` used by the plugin is compatible with the host runtime. See https://swc.rs/docs/plugin/selecting-swc-corefor compatibility information. If you are an author of the plugin, please update `swc_core` to the compatible version.
    2: RuntimeError: unreachable
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread '<unnamed>' panicked at src/transform/mod.rs:241:12:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread '' panicked at /Users/geist/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swc-0.273.24/src/plugin.rs:166:14:
failed to invoke plugin: failed to invoke plugin on 'Some("/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@bonterratech+stitch-extension@0.0.1_@bonterratech+stitch-tokens@0.0.15_@stylexjs+stylex@0.7._2zynpcwalujtmrkgy6ggfwv6vi/node_modules/@bonterratech/stitch-extension/dist/stitch-extension.es.js")'

Caused by:
    0: failed to invoke `/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@stylexswc+swc-plugin@0.2.2/node_modules/@stylexswc/swc-plugin/dist/stylex_swc_plugin.wasm` as js transform plugin at /Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@stylexswc+swc-plugin@0.2.2/node_modules/@stylexswc/swc-plugin/dist/stylex_swc_plugin.wasm
    1: failed to run Wasm plugin transform. Please ensure the version of `swc_core` used by the plugin is compatible with the host runtime. See https://swc.rs/docs/plugin/selecting-swc-corefor compatibility information. If you are an author of the plugin, please update `swc_core` to the compatible version.
    2: RuntimeError: unreachable
 ⨯ ./node_modules/.pnpm/@bonterratech+stitch-extension@0.0.1_@bonterratech+stitch-tokens@0.0.15_@stylexjs+stylex@0.7._2zynpcwalujtmrkgy6ggfwv6vi/node_modules/@bonterratech/stitch-extension/dist/stitch-extension.es.js
Error: failed to process failed to invoke plugin: failed to invoke plugin on 'Some("/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@bonterratech+stitch-extension@0.0.1_@bonterratech+stitch-tokens@0.0.15_@stylexjs+stylex@0.7._2zynpcwalujtmrkgy6ggfwv6vi/node_modules/@bonterratech/stitch-extension/dist/stitch-extension.es.js")'

Caused by:
    0: failed to invoke `/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@stylexswc+swc-plugin@0.2.2/node_modules/@stylexswc/swc-plugin/dist/stylex_swc_plugin.wasm` as js transform plugin at /Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@stylexswc+swc-plugin@0.2.2/node_modules/@stylexswc/swc-plugin/dist/stylex_swc_plugin.wasm
    1: failed to run Wasm plugin transform. Please ensure the version of `swc_core` used by the plugin is compatible with the host runtime. See https://swc.rs/docs/plugin/selecting-swc-corefor compatibility information. If you are an author of the plugin, please update `swc_core` to the compatible version.
    2: RuntimeError: unreachable

Import trace for requested module:
./node_modules/.pnpm/@bonterratech+stitch-extension@0.0.1_@bonterratech+stitch-tokens@0.0.15_@stylexjs+stylex@0.7._2zynpcwalujtmrkgy6ggfwv6vi/node_modules/@bonterratech/stitch-extension/dist/stitch-extension.es.js
./app/layout.tsx
!!!GETTING WEBPACK CONFIG!!!
======================
Count: 4
Build ID: development
Server: false
Env: dev
thread '<unnamed>' panicked at src/transform/mod.rs:241:12:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread '' panicked at /Users/geist/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swc-0.273.24/src/plugin.rs:166:14:
failed to invoke plugin: failed to invoke plugin on 'Some("/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@bonterratech+stitch-extension@0.0.1_@bonterratech+stitch-tokens@0.0.15_@stylexjs+stylex@0.7._2zynpcwalujtmrkgy6ggfwv6vi/node_modules/@bonterratech/stitch-extension/dist/stitch-extension.es.js")'

Caused by:
    0: failed to invoke `/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@stylexswc+swc-plugin@0.2.2/node_modules/@stylexswc/swc-plugin/dist/stylex_swc_plugin.wasm` as js transform plugin at /Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@stylexswc+swc-plugin@0.2.2/node_modules/@stylexswc/swc-plugin/dist/stylex_swc_plugin.wasm
    1: failed to run Wasm plugin transform. Please ensure the version of `swc_core` used by the plugin is compatible with the host runtime. See https://swc.rs/docs/plugin/selecting-swc-corefor compatibility information. If you are an author of the plugin, please update `swc_core` to the compatible version.
    2: RuntimeError: unreachable
thread '<unnamed>' panicked at src/transform/mod.rs:241:12:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread '' panicked at /Users/geist/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swc-0.273.24/src/plugin.rs:166:14:
failed to invoke plugin: failed to invoke plugin on 'Some("/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@bonterratech+stitch-extension@0.0.1_@bonterratech+stitch-tokens@0.0.15_@stylexjs+stylex@0.7._2zynpcwalujtmrkgy6ggfwv6vi/node_modules/@bonterratech/stitch-extension/dist/stitch-extension.es.js")'

Caused by:
    0: failed to invoke `/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@stylexswc+swc-plugin@0.2.2/node_modules/@stylexswc/swc-plugin/dist/stylex_swc_plugin.wasm` as js transform plugin at /Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@stylexswc+swc-plugin@0.2.2/node_modules/@stylexswc/swc-plugin/dist/stylex_swc_plugin.wasm
    1: failed to run Wasm plugin transform. Please ensure the version of `swc_core` used by the plugin is compatible with the host runtime. See https://swc.rs/docs/plugin/selecting-swc-corefor compatibility information. If you are an author of the plugin, please update `swc_core` to the compatible version.
    2: RuntimeError: unreachable
thread '<unnamed>' panicked at src/transform/mod.rs:241:12:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread '' panicked at /Users/geist/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swc-0.273.24/src/plugin.rs:166:14:
failed to invoke plugin: failed to invoke plugin on 'Some("/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@bonterratech+stitch-extension@0.0.1_@bonterratech+stitch-tokens@0.0.15_@stylexjs+stylex@0.7._2zynpcwalujtmrkgy6ggfwv6vi/node_modules/@bonterratech/stitch-extension/dist/stitch-extension.es.js")'

Caused by:
    0: failed to invoke `/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@stylexswc+swc-plugin@0.2.2/node_modules/@stylexswc/swc-plugin/dist/stylex_swc_plugin.wasm` as js transform plugin at /Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@stylexswc+swc-plugin@0.2.2/node_modules/@stylexswc/swc-plugin/dist/stylex_swc_plugin.wasm
    1: failed to run Wasm plugin transform. Please ensure the version of `swc_core` used by the plugin is compatible with the host runtime. See https://swc.rs/docs/plugin/selecting-swc-corefor compatibility information. If you are an author of the plugin, please update `swc_core` to the compatible version.
    2: RuntimeError: unreachable
thread '<unnamed>' panicked at src/transform/mod.rs:241:12:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread '' panicked at /Users/geist/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swc-0.273.24/src/plugin.rs:166:14:
failed to invoke plugin: failed to invoke plugin on 'Some("/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@bonterratech+stitch-extension@0.0.1_@bonterratech+stitch-tokens@0.0.15_@stylexjs+stylex@0.7._2zynpcwalujtmrkgy6ggfwv6vi/node_modules/@bonterratech/stitch-extension/dist/stitch-extension.es.js")'

Caused by:
    0: failed to invoke `/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@stylexswc+swc-plugin@0.2.2/node_modules/@stylexswc/swc-plugin/dist/stylex_swc_plugin.wasm` as js transform plugin at /Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@stylexswc+swc-plugin@0.2.2/node_modules/@stylexswc/swc-plugin/dist/stylex_swc_plugin.wasm
    1: failed to run Wasm plugin transform. Please ensure the version of `swc_core` used by the plugin is compatible with the host runtime. See https://swc.rs/docs/plugin/selecting-swc-corefor compatibility information. If you are an author of the plugin, please update `swc_core` to the compatible version.
    2: RuntimeError: unreachable
 ⨯ ./node_modules/.pnpm/@bonterratech+stitch-extension@0.0.1_@bonterratech+stitch-tokens@0.0.15_@stylexjs+stylex@0.7._2zynpcwalujtmrkgy6ggfwv6vi/node_modules/@bonterratech/stitch-extension/dist/stitch-extension.es.js
Error: failed to process failed to invoke plugin: failed to invoke plugin on 'Some("/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@bonterratech+stitch-extension@0.0.1_@bonterratech+stitch-tokens@0.0.15_@stylexjs+stylex@0.7._2zynpcwalujtmrkgy6ggfwv6vi/node_modules/@bonterratech/stitch-extension/dist/stitch-extension.es.js")'

Caused by:
    0: failed to invoke `/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@stylexswc+swc-plugin@0.2.2/node_modules/@stylexswc/swc-plugin/dist/stylex_swc_plugin.wasm` as js transform plugin at /Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@stylexswc+swc-plugin@0.2.2/node_modules/@stylexswc/swc-plugin/dist/stylex_swc_plugin.wasm
    1: failed to run Wasm plugin transform. Please ensure the version of `swc_core` used by the plugin is compatible with the host runtime. See https://swc.rs/docs/plugin/selecting-swc-corefor compatibility information. If you are an author of the plugin, please update `swc_core` to the compatible version.
    2: RuntimeError: unreachable

Import trace for requested module:
./node_modules/.pnpm/@bonterratech+stitch-extension@0.0.1_@bonterratech+stitch-tokens@0.0.15_@stylexjs+stylex@0.7._2zynpcwalujtmrkgy6ggfwv6vi/node_modules/@bonterratech/stitch-extension/dist/stitch-extension.es.js
./app/layout.tsx
 GET / 500 in 2048ms
 GET / 500 in 648ms
BMCwebdev commented 2 months ago

Also pointing out the obvious, but this larger project does use pnpm instead of npm.

Dwlad90 commented 2 months ago

Ah, I was so excited to see this working. Thank you. However when I try to implement into my actual project my troubles take a new turn.

I will paste below the error I get in my console. The main thing it seems to be complaining about is the swc_core. I took the latest version of the demo you made, and I downgraded Next to ^14.2.4 (and associated packages) and React to ^18.3.1 so that it matched my project. The demo repo continues to work, so that doesn't appear to be the issue.

my next.config in the big project is nearly the same as the demo repo. Not sure what could be causing the issue. Perhaps something in here stands out to you? I will keep poking at it as well.

pnpm run dev

> frontdoor-ui@0.1.0 predev /Users/brian.mccarthy/Development/npo-hub
> echo skip

skip

> frontdoor-ui@0.1.0 dev /Users/brian.mccarthy/Development/npo-hub
> next dev

  ▲ Next.js 14.2.12
  - Local:        http://localhost:3000
  - Environments: .env.development
  - Experiments (use with caution):
    · swcPlugins

 ✓ Starting...
!!!GETTING WEBPACK CONFIG!!!
======================
Count: 1
Build ID: development
Server: true
Env: dev
!!!GETTING WEBPACK CONFIG!!!
======================
Count: 2
Build ID: development
Server: true
Env: dev
!!!GETTING WEBPACK CONFIG!!!
======================
Count: 3
Build ID: development
Server: false
Env: dev
 ✓ Ready in 1687ms
 ○ Compiling /middleware ...
thread '<unnamed>' panicked at src/transform/mod.rs:241:12:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread '' panicked at /Users/geist/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swc-0.273.24/src/plugin.rs:166:14:
failed to invoke plugin: failed to invoke plugin on 'Some("/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@bonterratech+stitch-extension@0.0.1_@bonterratech+stitch-tokens@0.0.15_@stylexjs+stylex@0.7._2zynpcwalujtmrkgy6ggfwv6vi/node_modules/@bonterratech/stitch-extension/dist/stitch-extension.es.js")'

Caused by:
    0: failed to invoke `/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@stylexswc+swc-plugin@0.2.2/node_modules/@stylexswc/swc-plugin/dist/stylex_swc_plugin.wasm` as js transform plugin at /Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@stylexswc+swc-plugin@0.2.2/node_modules/@stylexswc/swc-plugin/dist/stylex_swc_plugin.wasm
    1: failed to run Wasm plugin transform. Please ensure the version of `swc_core` used by the plugin is compatible with the host runtime. See https://swc.rs/docs/plugin/selecting-swc-corefor compatibility information. If you are an author of the plugin, please update `swc_core` to the compatible version.
    2: RuntimeError: unreachable
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread '<unnamed>' panicked at src/transform/mod.rs:241:12:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread '' panicked at /Users/geist/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swc-0.273.24/src/plugin.rs:166:14:
failed to invoke plugin: failed to invoke plugin on 'Some("/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@bonterratech+stitch-extension@0.0.1_@bonterratech+stitch-tokens@0.0.15_@stylexjs+stylex@0.7._2zynpcwalujtmrkgy6ggfwv6vi/node_modules/@bonterratech/stitch-extension/dist/stitch-extension.es.js")'

Caused by:
    0: failed to invoke `/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@stylexswc+swc-plugin@0.2.2/node_modules/@stylexswc/swc-plugin/dist/stylex_swc_plugin.wasm` as js transform plugin at /Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@stylexswc+swc-plugin@0.2.2/node_modules/@stylexswc/swc-plugin/dist/stylex_swc_plugin.wasm
    1: failed to run Wasm plugin transform. Please ensure the version of `swc_core` used by the plugin is compatible with the host runtime. See https://swc.rs/docs/plugin/selecting-swc-corefor compatibility information. If you are an author of the plugin, please update `swc_core` to the compatible version.
    2: RuntimeError: unreachable
 ⨯ ./node_modules/.pnpm/@bonterratech+stitch-extension@0.0.1_@bonterratech+stitch-tokens@0.0.15_@stylexjs+stylex@0.7._2zynpcwalujtmrkgy6ggfwv6vi/node_modules/@bonterratech/stitch-extension/dist/stitch-extension.es.js
Error: failed to process failed to invoke plugin: failed to invoke plugin on 'Some("/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@bonterratech+stitch-extension@0.0.1_@bonterratech+stitch-tokens@0.0.15_@stylexjs+stylex@0.7._2zynpcwalujtmrkgy6ggfwv6vi/node_modules/@bonterratech/stitch-extension/dist/stitch-extension.es.js")'

Caused by:
    0: failed to invoke `/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@stylexswc+swc-plugin@0.2.2/node_modules/@stylexswc/swc-plugin/dist/stylex_swc_plugin.wasm` as js transform plugin at /Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@stylexswc+swc-plugin@0.2.2/node_modules/@stylexswc/swc-plugin/dist/stylex_swc_plugin.wasm
    1: failed to run Wasm plugin transform. Please ensure the version of `swc_core` used by the plugin is compatible with the host runtime. See https://swc.rs/docs/plugin/selecting-swc-corefor compatibility information. If you are an author of the plugin, please update `swc_core` to the compatible version.
    2: RuntimeError: unreachable

Import trace for requested module:
./node_modules/.pnpm/@bonterratech+stitch-extension@0.0.1_@bonterratech+stitch-tokens@0.0.15_@stylexjs+stylex@0.7._2zynpcwalujtmrkgy6ggfwv6vi/node_modules/@bonterratech/stitch-extension/dist/stitch-extension.es.js
./app/layout.tsx
!!!GETTING WEBPACK CONFIG!!!
======================
Count: 4
Build ID: development
Server: false
Env: dev
thread '<unnamed>' panicked at src/transform/mod.rs:241:12:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread '' panicked at /Users/geist/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swc-0.273.24/src/plugin.rs:166:14:
failed to invoke plugin: failed to invoke plugin on 'Some("/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@bonterratech+stitch-extension@0.0.1_@bonterratech+stitch-tokens@0.0.15_@stylexjs+stylex@0.7._2zynpcwalujtmrkgy6ggfwv6vi/node_modules/@bonterratech/stitch-extension/dist/stitch-extension.es.js")'

Caused by:
    0: failed to invoke `/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@stylexswc+swc-plugin@0.2.2/node_modules/@stylexswc/swc-plugin/dist/stylex_swc_plugin.wasm` as js transform plugin at /Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@stylexswc+swc-plugin@0.2.2/node_modules/@stylexswc/swc-plugin/dist/stylex_swc_plugin.wasm
    1: failed to run Wasm plugin transform. Please ensure the version of `swc_core` used by the plugin is compatible with the host runtime. See https://swc.rs/docs/plugin/selecting-swc-corefor compatibility information. If you are an author of the plugin, please update `swc_core` to the compatible version.
    2: RuntimeError: unreachable
thread '<unnamed>' panicked at src/transform/mod.rs:241:12:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread '' panicked at /Users/geist/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swc-0.273.24/src/plugin.rs:166:14:
failed to invoke plugin: failed to invoke plugin on 'Some("/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@bonterratech+stitch-extension@0.0.1_@bonterratech+stitch-tokens@0.0.15_@stylexjs+stylex@0.7._2zynpcwalujtmrkgy6ggfwv6vi/node_modules/@bonterratech/stitch-extension/dist/stitch-extension.es.js")'

Caused by:
    0: failed to invoke `/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@stylexswc+swc-plugin@0.2.2/node_modules/@stylexswc/swc-plugin/dist/stylex_swc_plugin.wasm` as js transform plugin at /Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@stylexswc+swc-plugin@0.2.2/node_modules/@stylexswc/swc-plugin/dist/stylex_swc_plugin.wasm
    1: failed to run Wasm plugin transform. Please ensure the version of `swc_core` used by the plugin is compatible with the host runtime. See https://swc.rs/docs/plugin/selecting-swc-corefor compatibility information. If you are an author of the plugin, please update `swc_core` to the compatible version.
    2: RuntimeError: unreachable
thread '<unnamed>' panicked at src/transform/mod.rs:241:12:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread '' panicked at /Users/geist/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swc-0.273.24/src/plugin.rs:166:14:
failed to invoke plugin: failed to invoke plugin on 'Some("/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@bonterratech+stitch-extension@0.0.1_@bonterratech+stitch-tokens@0.0.15_@stylexjs+stylex@0.7._2zynpcwalujtmrkgy6ggfwv6vi/node_modules/@bonterratech/stitch-extension/dist/stitch-extension.es.js")'

Caused by:
    0: failed to invoke `/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@stylexswc+swc-plugin@0.2.2/node_modules/@stylexswc/swc-plugin/dist/stylex_swc_plugin.wasm` as js transform plugin at /Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@stylexswc+swc-plugin@0.2.2/node_modules/@stylexswc/swc-plugin/dist/stylex_swc_plugin.wasm
    1: failed to run Wasm plugin transform. Please ensure the version of `swc_core` used by the plugin is compatible with the host runtime. See https://swc.rs/docs/plugin/selecting-swc-corefor compatibility information. If you are an author of the plugin, please update `swc_core` to the compatible version.
    2: RuntimeError: unreachable
thread '<unnamed>' panicked at src/transform/mod.rs:241:12:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread '' panicked at /Users/geist/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swc-0.273.24/src/plugin.rs:166:14:
failed to invoke plugin: failed to invoke plugin on 'Some("/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@bonterratech+stitch-extension@0.0.1_@bonterratech+stitch-tokens@0.0.15_@stylexjs+stylex@0.7._2zynpcwalujtmrkgy6ggfwv6vi/node_modules/@bonterratech/stitch-extension/dist/stitch-extension.es.js")'

Caused by:
    0: failed to invoke `/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@stylexswc+swc-plugin@0.2.2/node_modules/@stylexswc/swc-plugin/dist/stylex_swc_plugin.wasm` as js transform plugin at /Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@stylexswc+swc-plugin@0.2.2/node_modules/@stylexswc/swc-plugin/dist/stylex_swc_plugin.wasm
    1: failed to run Wasm plugin transform. Please ensure the version of `swc_core` used by the plugin is compatible with the host runtime. See https://swc.rs/docs/plugin/selecting-swc-corefor compatibility information. If you are an author of the plugin, please update `swc_core` to the compatible version.
    2: RuntimeError: unreachable
 ⨯ ./node_modules/.pnpm/@bonterratech+stitch-extension@0.0.1_@bonterratech+stitch-tokens@0.0.15_@stylexjs+stylex@0.7._2zynpcwalujtmrkgy6ggfwv6vi/node_modules/@bonterratech/stitch-extension/dist/stitch-extension.es.js
Error: failed to process failed to invoke plugin: failed to invoke plugin on 'Some("/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@bonterratech+stitch-extension@0.0.1_@bonterratech+stitch-tokens@0.0.15_@stylexjs+stylex@0.7._2zynpcwalujtmrkgy6ggfwv6vi/node_modules/@bonterratech/stitch-extension/dist/stitch-extension.es.js")'

Caused by:
    0: failed to invoke `/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@stylexswc+swc-plugin@0.2.2/node_modules/@stylexswc/swc-plugin/dist/stylex_swc_plugin.wasm` as js transform plugin at /Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/@stylexswc+swc-plugin@0.2.2/node_modules/@stylexswc/swc-plugin/dist/stylex_swc_plugin.wasm
    1: failed to run Wasm plugin transform. Please ensure the version of `swc_core` used by the plugin is compatible with the host runtime. See https://swc.rs/docs/plugin/selecting-swc-corefor compatibility information. If you are an author of the plugin, please update `swc_core` to the compatible version.
    2: RuntimeError: unreachable

Import trace for requested module:
./node_modules/.pnpm/@bonterratech+stitch-extension@0.0.1_@bonterratech+stitch-tokens@0.0.15_@stylexjs+stylex@0.7._2zynpcwalujtmrkgy6ggfwv6vi/node_modules/@bonterratech/stitch-extension/dist/stitch-extension.es.js
./app/layout.tsx
 GET / 500 in 2048ms
 GET / 500 in 648ms

Thanks for finding bugs like this, it helps stabilize the plugin a lot.

This problem is absolutely not related to the plugin configuration. The incorrect behavior was related to a bug in the process of handling unassigned variables and was fixed in the PR. The fix will be available in the next release soon

Dwlad90 commented 2 months ago

Also pointing out the obvious, but this larger project does use pnpm instead of npm.

Nice, In the version 0.2.4, support for pnpm was added and a new demo app was created directly in the repository, which uses pnpm.

BMCwebdev commented 2 months ago

Hey there. So onto the next bump!

When I try to run dev now, I just get to Compiling stage and hang there. image

BMCwebdev commented 2 months ago

I am going to give a copy of some of my setup files to see if you see something wrong, or if you see a file I should give you more information on. I cannot make a demo of this app as it is large and also not permitted by my company :-(

Okay, file setup at top level. image

BMCwebdev commented 2 months ago

next.config.js

/** @type {import('next').NextConfig} */
const path = require('path');
const stylexPlugin = require('@stylexswc/nextjs-plugin');
const rootDir =  __dirname;

const nextConfig = {
  swcMinify: true,
  transpilePackages: [
    '@bonterratech/stitch-tokens',
    '@bonterratech/stitch-extension'
  ],
  pageExtensions: ['js', 'jsx', 'mdx', 'ts', 'tsx'],
  experimental: {
    swcPlugins: [[
      "@stylexswc/swc-plugin",
      {
        dev: process.env.NODE_ENV === 'development',
        genConditionalClasses: true,
        treeshakeCompensation: true,
        aliases: {
          '@/*': [path.join(rootDir, '*')],
        },
        unstable_moduleResolution: {
          type: 'commonJS',
          rootDir: rootDir,
        },
      },
    ]],
  },
  eslint: {
    ignoreDuringBuilds: true,
  },
  typescript: {
    ignoreBuildErrors: true,
  },
};

module.exports = stylexPlugin({
  rootDir: rootDir,
})(nextConfig);
BMCwebdev commented 2 months ago

package.json

{
  "name": "frontdoor-ui",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "predev": "rimraf .next",
    "prebuild": "rimraf .next",
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint",
    "prettier": "prettier . --write",
    "test": "jest",
    "test:watch": "jest --watch",
    "amp-config-gen": "npx ts-node ./utils/amplifyConfigGenerator.ts"
  },
  "dependencies": {
    "@aws-amplify/adapter-nextjs": "^1.0.28",
    "@aws-amplify/ui-react": "^6.1.6",
    "@aws-amplify/ui-react-native": "^2.1.2",
    "@aws-sdk/client-cognito-identity": "^3.529.1",
    "@bonterratech/stitch-extension": "^0.0.1",
    "@bonterratech/stitch-tokens": "^0.0.15",
    "@stylexjs/eslint-plugin": "^0.7.5",
    "@stylexjs/stylex": "^0.7.5",
    "@stylexswc/nextjs-plugin": "^0.2.4",
    "@stylexswc/swc-plugin": "^0.2.4",
    "amazon-cognito-identity-js": "^6.3.7",
    "aws-amplify": "^6.0.28",
    "aws-sdk": "^2.1574.0",
    "isbot": "^4.1.0",
    "jsdom": "^24.0.0",
    "lucide-react": "^0.396.0",
    "markdown-to-jsx": "^7.4.7",
    "next": "^14.2.4",
    "prettier": "^3.2.5",
    "react": "^18.3.1",
    "react-aria-components": "^1.3.3",
    "react-dom": "^18.3.1",
    "regenerator-runtime": "^0.14.1",
    "rimraf": "^5.0.5",
    "sharp": "^0.33.3",
    "tailwindcss": "^3.0.0",
    "zustand": "^4.5.2"
  },
  "devDependencies": {
    "@testing-library/jest-dom": "^6.4.5",
    "@testing-library/react": "^16.0.1",
    "@testing-library/react-hooks": "^8.0.1",
    "@types/jest": "^29.5.12",
    "@types/node": "^20.12.12",
    "@types/react": "^18.0.28",
    "@types/react-dom": "^18.0.11",
    "autoprefixer": "^10.0.1",
    "aws-cdk-lib": "2.132.1",
    "constructs": "10.3.0",
    "eslint": "^8",
    "eslint-config-next": "14.2.4",
    "extend-expect": "link:@testing-library/jest-dom/extend-expect",
    "jest": "^29.7.0",
    "jest-environment-jsdom": "^29.7.0",
    "node-fetch": "^3.3.2",
    "prettier": "^3.2.5",
    "sst": "^2.41.4",
    "ts-node": "^10.9.2",
    "typescript": "^5"
  },
  "resolutions": {
    "react": "^18.3.1",
    "react-dom": "^18.3.1",
    "tailwindcss": "^3.0.0",
    "@types/react": "^18.3.3"
  },
  "packageManager": "pnpm@9.5.0+sha512.140036830124618d624a2187b50d04289d5a087f326c9edfc0ccd733d76c4f52c3a313d4fc148794a2a9d81553016004e6742e8cf850670268a7387fc220"
}
BMCwebdev commented 2 months ago

Hang on one second! While I was typing this all out, it actually compiled! It just took an incredibly long time. I wonder why. Okay, let's see if I can re-create a successful compile!

BMCwebdev commented 2 months ago

Okay, it took just a few seconds under 5 minutes to compile. Then I got this error.

pnpm run dev

> frontdoor-ui@0.1.0 predev /Users/brian.mccarthy/Development/npo-hub
> rimraf .next

> frontdoor-ui@0.1.0 dev /Users/brian.mccarthy/Development/npo-hub
> next dev

  ▲ Next.js 14.2.13
  - Local:        http://localhost:3000
  - Experiments (use with caution):
    · swcPlugins

 ✓ Starting...
!!!GETTING WEBPACK CONFIG!!!
======================
Count: 1
Build ID: development
Server: true
Env: dev
!!!GETTING WEBPACK CONFIG!!!
======================
Count: 2
Build ID: development
Server: true
Env: dev
!!!GETTING WEBPACK CONFIG!!!
======================
Count: 3
Build ID: development
Server: false
Env: dev
 ✓ Ready in 1177ms
 ○ Compiling /middleware ...
 ✓ Compiled /middleware in 620ms (72 modules)
 ○ Compiling / ...
 ✓ Compiled / in 290.8s (5504 modules)
 GET / 200 in 128986ms
 GET / 200 in 291243ms
 ⨯ Internal error: TypeError: Failed to parse URL from undefinedusers/
    at node:internal/deps/undici/undici:12502:13
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
digest: "2890659504"
Cause: TypeError: Invalid URL
    at new URL (node:internal/url:797:36)
    at new Request (node:internal/deps/undici/undici:4853:25)
    at fetch (node:internal/deps/undici/undici:9662:25)
    at fetch (node:internal/deps/undici/undici:12500:10)
    at value (node:internal/bootstrap/web/exposed-window-or-worker:72:12)
    at doOriginalFetch (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/patch-fetch.js:440:24)
    at eval (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/patch-fetch.js:589:24)
    at eval (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/trace/tracer.js:134:36)
    at NoopContextManager.with (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:7062)
    at ContextAPI.with (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:518)
    at NoopTracer.startActiveSpan (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:18093)
    at ProxyTracer.startActiveSpan (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:18854)
    at eval (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/trace/tracer.js:116:103)
    at NoopContextManager.with (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:7062)
    at ContextAPI.with (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:518)
    at NextTracerImpl.trace (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/trace/tracer.js:116:28)
    at patched (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/patch-fetch.js:233:41)
    at getUserData (webpack-internal:///(action-browser)/./app/actions/getUserData/getUserData.ts:13:27)
    at endpoint (webpack-internal:///(action-browser)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/build/webpack/loaders/next-flight-action-entry-loader.js?actions=%5B%5B%22%2FUsers%2Fbrian.mccarthy%2FDevelopment%2Fnpo-hub%2Fapp%2Factions%2FgetUserData%2FgetUserData.ts%22%2C%5B%22default%22%5D%5D%2C%5B%22%2FUsers%2Fbrian.mccarthy%2FDevelopment%2Fnpo-hub%2Fapp%2Factions%2FutilActions.ts%22%2C%5B%22redirectHome%22%2C%22redirectToGrantWriter%22%5D%5D%5D&__client_imported__=true!:10:17)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:39:418
    at async r_ (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:38:8148)
    at async r8 (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:41:1256)
    at async doRender (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:1406:30)
    at async cacheEntry.responseCache.get.routeKind (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:1567:28)
    at async DevServer.renderToResponseWithComponentsImpl (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:1475:28)
    at async DevServer.renderPageComponent (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:1901:24)
    at async DevServer.renderToResponseImpl (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:1939:32)
    at async DevServer.pipeImpl (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:914:25)
    at async NextNodeServer.handleCatchallRenderRequest (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/next-server.js:272:17)
    at async DevServer.handleRequestImpl (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:810:17)
    at async /Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/dev/next-dev-server.js:339:20
    at async Span.traceAsyncFn (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/trace/trace.js:154:20)
    at async DevServer.handleRequest (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/dev/next-dev-server.js:336:24)
    at async invokeRender (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/router-server.js:173:21)
    at async handleRequest (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/router-server.js:350:24)
    at async requestHandlerImpl (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/router-server.js:374:13)
    at async Server.requestListener (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/start-server.js:141:13) {
  code: 'ERR_INVALID_URL',
  input: 'undefinedusers/'
}
 POST / 500 in 31ms
 ⨯ Internal error: TypeError: Failed to parse URL from undefinedusers/
    at node:internal/deps/undici/undici:12502:13
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
digest: "2890659504"
Cause: TypeError: Invalid URL
    at new URL (node:internal/url:797:36)
    at new Request (node:internal/deps/undici/undici:4853:25)
    at fetch (node:internal/deps/undici/undici:9662:25)
    at fetch (node:internal/deps/undici/undici:12500:10)
    at value (node:internal/bootstrap/web/exposed-window-or-worker:72:12)
    at doOriginalFetch (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/patch-fetch.js:440:24)
    at eval (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/patch-fetch.js:589:24)
    at eval (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/trace/tracer.js:134:36)
    at NoopContextManager.with (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:7062)
    at ContextAPI.with (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:518)
    at NoopTracer.startActiveSpan (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:18093)
    at ProxyTracer.startActiveSpan (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:18854)
    at eval (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/trace/tracer.js:116:103)
    at NoopContextManager.with (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:7062)
    at ContextAPI.with (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:518)
    at NextTracerImpl.trace (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/trace/tracer.js:116:28)
    at patched (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/patch-fetch.js:233:41)
    at getUserData (webpack-internal:///(action-browser)/./app/actions/getUserData/getUserData.ts:13:27)
    at endpoint (webpack-internal:///(action-browser)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/build/webpack/loaders/next-flight-action-entry-loader.js?actions=%5B%5B%22%2FUsers%2Fbrian.mccarthy%2FDevelopment%2Fnpo-hub%2Fapp%2Factions%2FgetUserData%2FgetUserData.ts%22%2C%5B%22default%22%5D%5D%2C%5B%22%2FUsers%2Fbrian.mccarthy%2FDevelopment%2Fnpo-hub%2Fapp%2Factions%2FutilActions.ts%22%2C%5B%22redirectHome%22%2C%22redirectToGrantWriter%22%5D%5D%5D&__client_imported__=true!:10:17)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:39:418
    at async r_ (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:38:8148)
    at async r8 (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:41:1256)
    at async doRender (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:1406:30)
    at async cacheEntry.responseCache.get.routeKind (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:1567:28)
    at async DevServer.renderToResponseWithComponentsImpl (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:1475:28)
    at async DevServer.renderPageComponent (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:1901:24)
    at async DevServer.renderToResponseImpl (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:1939:32)
    at async DevServer.pipeImpl (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:914:25)
    at async NextNodeServer.handleCatchallRenderRequest (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/next-server.js:272:17)
    at async DevServer.handleRequestImpl (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:810:17)
    at async /Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/dev/next-dev-server.js:339:20
    at async Span.traceAsyncFn (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/trace/trace.js:154:20)
    at async DevServer.handleRequest (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/dev/next-dev-server.js:336:24)
    at async invokeRender (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/router-server.js:173:21)
    at async handleRequest (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/router-server.js:350:24)
    at async requestHandlerImpl (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/router-server.js:374:13)
    at async Server.requestListener (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/start-server.js:141:13) {
  code: 'ERR_INVALID_URL',
  input: 'undefinedusers/'
}
 POST / 500 in 16ms
 ⨯ Internal error: TypeError: Failed to parse URL from undefinedusers/
    at node:internal/deps/undici/undici:12502:13
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
digest: "2890659504"
Cause: TypeError: Invalid URL
    at new URL (node:internal/url:797:36)
    at new Request (node:internal/deps/undici/undici:4853:25)
    at fetch (node:internal/deps/undici/undici:9662:25)
    at fetch (node:internal/deps/undici/undici:12500:10)
    at value (node:internal/bootstrap/web/exposed-window-or-worker:72:12)
    at doOriginalFetch (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/patch-fetch.js:440:24)
    at eval (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/patch-fetch.js:589:24)
    at eval (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/trace/tracer.js:134:36)
    at NoopContextManager.with (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:7062)
    at ContextAPI.with (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:518)
    at NoopTracer.startActiveSpan (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:18093)
    at ProxyTracer.startActiveSpan (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:18854)
    at eval (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/trace/tracer.js:116:103)
    at NoopContextManager.with (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:7062)
    at ContextAPI.with (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:518)
    at NextTracerImpl.trace (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/trace/tracer.js:116:28)
    at patched (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/patch-fetch.js:233:41)
    at getUserData (webpack-internal:///(action-browser)/./app/actions/getUserData/getUserData.ts:13:27)
    at endpoint (webpack-internal:///(action-browser)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/build/webpack/loaders/next-flight-action-entry-loader.js?actions=%5B%5B%22%2FUsers%2Fbrian.mccarthy%2FDevelopment%2Fnpo-hub%2Fapp%2Factions%2FgetUserData%2FgetUserData.ts%22%2C%5B%22default%22%5D%5D%2C%5B%22%2FUsers%2Fbrian.mccarthy%2FDevelopment%2Fnpo-hub%2Fapp%2Factions%2FutilActions.ts%22%2C%5B%22redirectHome%22%2C%22redirectToGrantWriter%22%5D%5D%5D&__client_imported__=true!:10:17)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:39:418
    at async r_ (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:38:8148)
    at async r8 (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:41:1256)
    at async doRender (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:1406:30)
    at async cacheEntry.responseCache.get.routeKind (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:1567:28)
    at async DevServer.renderToResponseWithComponentsImpl (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:1475:28)
    at async DevServer.renderPageComponent (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:1901:24)
    at async DevServer.renderToResponseImpl (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:1939:32)
    at async DevServer.pipeImpl (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:914:25)
    at async NextNodeServer.handleCatchallRenderRequest (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/next-server.js:272:17)
    at async DevServer.handleRequestImpl (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:810:17)
    at async /Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/dev/next-dev-server.js:339:20
    at async Span.traceAsyncFn (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/trace/trace.js:154:20)
    at async DevServer.handleRequest (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/dev/next-dev-server.js:336:24)
    at async invokeRender (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/router-server.js:173:21)
    at async handleRequest (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/router-server.js:350:24)
    at async requestHandlerImpl (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/router-server.js:374:13)
    at async Server.requestListener (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/start-server.js:141:13) {
  code: 'ERR_INVALID_URL',
  input: 'undefinedusers/'
}
 POST / 500 in 14ms
 ⨯ Internal error: TypeError: Failed to parse URL from undefinedusers/
    at node:internal/deps/undici/undici:12502:13
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
digest: "2890659504"
Cause: TypeError: Invalid URL
    at new URL (node:internal/url:797:36)
    at new Request (node:internal/deps/undici/undici:4853:25)
    at fetch (node:internal/deps/undici/undici:9662:25)
    at fetch (node:internal/deps/undici/undici:12500:10)
    at value (node:internal/bootstrap/web/exposed-window-or-worker:72:12)
    at doOriginalFetch (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/patch-fetch.js:440:24)
    at eval (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/patch-fetch.js:589:24)
    at eval (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/trace/tracer.js:134:36)
    at NoopContextManager.with (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:7062)
    at ContextAPI.with (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:518)
    at NoopTracer.startActiveSpan (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:18093)
    at ProxyTracer.startActiveSpan (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:18854)
    at eval (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/trace/tracer.js:116:103)
    at NoopContextManager.with (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:7062)
    at ContextAPI.with (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:518)
    at NextTracerImpl.trace (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/trace/tracer.js:116:28)
    at patched (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/patch-fetch.js:233:41)
    at getUserData (webpack-internal:///(action-browser)/./app/actions/getUserData/getUserData.ts:13:27)
    at endpoint (webpack-internal:///(action-browser)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/build/webpack/loaders/next-flight-action-entry-loader.js?actions=%5B%5B%22%2FUsers%2Fbrian.mccarthy%2FDevelopment%2Fnpo-hub%2Fapp%2Factions%2FgetUserData%2FgetUserData.ts%22%2C%5B%22default%22%5D%5D%2C%5B%22%2FUsers%2Fbrian.mccarthy%2FDevelopment%2Fnpo-hub%2Fapp%2Factions%2FutilActions.ts%22%2C%5B%22redirectHome%22%2C%22redirectToGrantWriter%22%5D%5D%5D&__client_imported__=true!:10:17)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:39:418
    at async r_ (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:38:8148)
    at async r8 (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:41:1256)
    at async doRender (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:1406:30)
    at async cacheEntry.responseCache.get.routeKind (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:1567:28)
    at async DevServer.renderToResponseWithComponentsImpl (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:1475:28)
    at async DevServer.renderPageComponent (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:1901:24)
    at async DevServer.renderToResponseImpl (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:1939:32)
    at async DevServer.pipeImpl (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:914:25)
    at async NextNodeServer.handleCatchallRenderRequest (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/next-server.js:272:17)
    at async DevServer.handleRequestImpl (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:810:17)
    at async /Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/dev/next-dev-server.js:339:20
    at async Span.traceAsyncFn (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/trace/trace.js:154:20)
    at async DevServer.handleRequest (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/dev/next-dev-server.js:336:24)
    at async invokeRender (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/router-server.js:173:21)
    at async handleRequest (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/router-server.js:350:24)
    at async requestHandlerImpl (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/router-server.js:374:13)
    at async Server.requestListener (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/start-server.js:141:13) {
  code: 'ERR_INVALID_URL',
  input: 'undefinedusers/'
}
 POST / 500 in 20ms

if I try to navigate away from the page or make changes to it I get errors like this

  ⨯ ./app/components/Organizations/OrgCard/OrgCard.tsx
TypeError: Cannot read properties of undefined (reading 'watcher')
    at Set.forEach (<anonymous>)
    at Set.forEach (<anonymous>)
Import trace for requested module:
./app/components/Organizations/OrgCard/OrgCard.tsx
 ○ Compiling /organizations ...
 ⨯ ./app/components/Organizations/OrgCard/OrgCard.tsx
TypeError: Cannot read properties of undefined (reading 'watcher')
    at Set.forEach (<anonymous>)
    at Set.forEach (<anonymous>)
Import trace for requested module:
./app/components/Organizations/OrgCard/OrgCard.tsx
!!!GETTING WEBPACK CONFIG!!!
======================
Count: 4
Build ID: development
Server: false
Env: dev
 ⨯ ./app/components/Organizations/OrgCard/OrgCard.tsx
TypeError: Cannot read properties of undefined (reading 'watcher')
    at Set.forEach (<anonymous>)
    at Set.forEach (<anonymous>)
Import trace for requested module:
./app/components/Organizations/OrgCard/OrgCard.tsx
 GET / 500 in 23ms
 GET /organizations 500 in 21ms
BMCwebdev commented 2 months ago

I think at this point I am dealing with something on my end, but just wanted to keep you up to date. Of course if you see something, always welcome to suggestions.

Dwlad90 commented 2 months ago

The configuration looks similar to the demo app configuration, I don't think that's the problem.

The error stack you provided above looks similar: in both cases the value is undefined, which may be a consequence of the code transformation using @stylexswc/swc-plugin, as it was in this issue.

If you find that the problem is indeed related to the SWC plugin or can provide a little more information, I'll be happy to help.

BMCwebdev commented 2 months ago

This is the setup test code I am using in my larger app. Note I am not using my tokens.

import * as stylex from '@stylexjs/stylex';

const listBoxItemStyles = stylex.create({
  base: {
    backgroundColor: "red"
  }
});

export default function Home() {
  return (
    <div {...stylex.props(listBoxItemStyles.base)}>hello</div>
  );
}

After about 5 mins of compiling, it will render the page with the styles. I also get this in the terminal

NODE_OPTIONS='--trace-warnings' node_modules/.bin/next dev          
  ▲ Next.js 14.2.13
  - Local:        http://localhost:3000
  - Experiments (use with caution):
    · swcPlugins

 ✓ Starting...
!!!GETTING WEBPACK CONFIG!!!
======================
Count: 1
Build ID: development
Server: true
Env: dev
!!!GETTING WEBPACK CONFIG!!!
======================
Count: 2
Build ID: development
Server: true
Env: dev
!!!GETTING WEBPACK CONFIG!!!
======================
Count: 3
Build ID: development
Server: false
Env: dev
 ✓ Ready in 1172ms
 ○ Compiling /middleware ...
 ✓ Compiled /middleware in 586ms (72 modules)
 ○ Compiling /home ...
 ✓ Compiled /home in 290.5s (5491 modules)
 GET /home 200 in 291106ms
 ⨯ Internal error: TypeError: Failed to parse URL from undefinedusers/
    at node:internal/deps/undici/undici:12502:13
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
digest: "2890659504"
Cause: TypeError: Invalid URL
    at new URL (node:internal/url:797:36)
    at new Request (node:internal/deps/undici/undici:4853:25)
    at fetch (node:internal/deps/undici/undici:9662:25)
    at fetch (node:internal/deps/undici/undici:12500:10)
    at value (node:internal/bootstrap/web/exposed-window-or-worker:72:12)
    at doOriginalFetch (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/patch-fetch.js:440:24)
    at eval (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/patch-fetch.js:589:24)
    at eval (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/trace/tracer.js:134:36)
    at NoopContextManager.with (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:7062)
    at ContextAPI.with (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:518)
    at NoopTracer.startActiveSpan (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:18093)
    at ProxyTracer.startActiveSpan (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:18854)
    at eval (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/trace/tracer.js:116:103)
    at NoopContextManager.with (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:7062)
    at ContextAPI.with (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:518)
    at NextTracerImpl.trace (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/trace/tracer.js:116:28)
    at patched (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/patch-fetch.js:233:41)
    at getUserData (webpack-internal:///(action-browser)/./app/actions/getUserData/getUserData.ts:13:27)
    at endpoint (webpack-internal:///(action-browser)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/build/webpack/loaders/next-flight-action-entry-loader.js?actions=%5B%5B%22%2FUsers%2Fbrian.mccarthy%2FDevelopment%2Fnpo-hub%2Fapp%2Factions%2FgetUserData%2FgetUserData.ts%22%2C%5B%22default%22%5D%5D%2C%5B%22%2FUsers%2Fbrian.mccarthy%2FDevelopment%2Fnpo-hub%2Fapp%2Factions%2FutilActions.ts%22%2C%5B%22redirectHome%22%2C%22redirectToGrantWriter%22%5D%5D%5D&__client_imported__=true!:10:17)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:39:418
    at async r_ (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:38:8148)
    at async r8 (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:41:1256)
    at async doRender (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:1406:30)
    at async cacheEntry.responseCache.get.routeKind (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:1567:28)
    at async DevServer.renderToResponseWithComponentsImpl (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:1475:28)
    at async DevServer.renderPageComponent (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:1901:24)
    at async DevServer.renderToResponseImpl (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:1939:32)
    at async DevServer.pipeImpl (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:914:25)
    at async NextNodeServer.handleCatchallRenderRequest (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/next-server.js:272:17)
    at async DevServer.handleRequestImpl (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:810:17)
    at async /Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/dev/next-dev-server.js:339:20
    at async Span.traceAsyncFn (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/trace/trace.js:154:20)
    at async DevServer.handleRequest (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/dev/next-dev-server.js:336:24)
    at async invokeRender (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/router-server.js:173:21)
    at async handleRequest (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/router-server.js:350:24)
    at async requestHandlerImpl (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/router-server.js:374:13)
    at async Server.requestListener (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/start-server.js:141:13) {
  code: 'ERR_INVALID_URL',
  input: 'undefinedusers/'
}
 POST /home 500 in 25ms
 ⨯ Internal error: TypeError: Failed to parse URL from undefinedusers/
    at node:internal/deps/undici/undici:12502:13
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
digest: "2890659504"
Cause: TypeError: Invalid URL
    at new URL (node:internal/url:797:36)
    at new Request (node:internal/deps/undici/undici:4853:25)
    at fetch (node:internal/deps/undici/undici:9662:25)
    at fetch (node:internal/deps/undici/undici:12500:10)
    at value (node:internal/bootstrap/web/exposed-window-or-worker:72:12)
    at doOriginalFetch (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/patch-fetch.js:440:24)
    at eval (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/patch-fetch.js:589:24)
    at eval (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/trace/tracer.js:134:36)
    at NoopContextManager.with (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:7062)
    at ContextAPI.with (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:518)
    at NoopTracer.startActiveSpan (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:18093)
    at ProxyTracer.startActiveSpan (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:18854)
    at eval (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/trace/tracer.js:116:103)
    at NoopContextManager.with (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:7062)
    at ContextAPI.with (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/@opentelemetry/api/index.js:1:518)
    at NextTracerImpl.trace (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/trace/tracer.js:116:28)
    at patched (webpack-internal:///(rsc)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/patch-fetch.js:233:41)
    at getUserData (webpack-internal:///(action-browser)/./app/actions/getUserData/getUserData.ts:13:27)
    at endpoint (webpack-internal:///(action-browser)/./node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/build/webpack/loaders/next-flight-action-entry-loader.js?actions=%5B%5B%22%2FUsers%2Fbrian.mccarthy%2FDevelopment%2Fnpo-hub%2Fapp%2Factions%2FgetUserData%2FgetUserData.ts%22%2C%5B%22default%22%5D%5D%2C%5B%22%2FUsers%2Fbrian.mccarthy%2FDevelopment%2Fnpo-hub%2Fapp%2Factions%2FutilActions.ts%22%2C%5B%22redirectHome%22%2C%22redirectToGrantWriter%22%5D%5D%5D&__client_imported__=true!:10:17)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:39:418
    at async r_ (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:38:8148)
    at async r8 (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:41:1256)
    at async doRender (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:1406:30)
    at async cacheEntry.responseCache.get.routeKind (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:1567:28)
    at async DevServer.renderToResponseWithComponentsImpl (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:1475:28)
    at async DevServer.renderPageComponent (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:1901:24)
    at async DevServer.renderToResponseImpl (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:1939:32)
    at async DevServer.pipeImpl (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:914:25)
    at async NextNodeServer.handleCatchallRenderRequest (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/next-server.js:272:17)
    at async DevServer.handleRequestImpl (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:810:17)
    at async /Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/dev/next-dev-server.js:339:20
    at async Span.traceAsyncFn (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/trace/trace.js:154:20)
    at async DevServer.handleRequest (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/dev/next-dev-server.js:336:24)
    at async invokeRender (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/router-server.js:173:21)
    at async handleRequest (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/router-server.js:350:24)
    at async requestHandlerImpl (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/router-server.js:374:13)
    at async Server.requestListener (/Users/brian.mccarthy/Development/npo-hub/node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/start-server.js:141:13) {
  code: 'ERR_INVALID_URL',
  input: 'undefinedusers/'
}
 POST /home 500 in 9ms

if I try to make changes or refresh the page, it will fail and I get this

 ⨯ ./app/components/Home/Home.tsx
TypeError: Cannot read properties of undefined (reading 'watcher')
    at Set.forEach (<anonymous>)
    at Set.forEach (<anonymous>)
Import trace for requested module:
./app/components/Home/Home.tsx
./app/components/Home/index.ts
./app/home/page.tsx
Dwlad90 commented 2 months ago

I created a reproduction with the provided code and everything works correctly.

Maybe there is something else that can cause this error and that can be checked in the reproduction?

Demo repository and sandbox

Direct link to the page

BMCwebdev commented 2 months ago

Ah, my larger application uses @ aliases. I see you have a path resolver. Going to give that a try.

BMCwebdev commented 2 months ago

I will give you an update soon, needed to focus on closing a sprint first 🙂

BMCwebdev commented 1 month ago

Hey again. Is there any value for you in my attempting to give this another go, or should I just wait for the new compiler you are working on to be released? It seems like eventually you are going to let this compiler fade. I'm happy either way!

Dwlad90 commented 1 month ago

Hi, The new compiler will be released very soon. In version 0.3.0 there will be no fundamental differences from StyleX SWC plugin in the processing of StyleX styles , since under the hood the new compiler uses the SWC transformer.

I would recommend waiting for the release of the new compiler, since it will be a priority and the main focus in the future will be on it.

P.S. I'd be happy to receive feedback on the new compiler after its release😉

Dwlad90 commented 1 month ago

Hi @BMCwebdev,

Version 0.3.0, which includes the new compiler, was published on npm.

BMCwebdev commented 1 month ago

Oh great news, I will give it a go tomorrow!