lxsmnsyc / solid-styled

Reactive stylesheets for SolidJS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`Uncaught Error: Missing StyleRegistry`

trusktr opened this issue · comments

I have an app that uses solid-app-router (maybe that has to do with it), and I get that error. Working on a repro...

Repro: https://github.com/trusktr/solid-styled/tree/solid-styled-issue-2

Unfortunately this simple reproduction attempt doesn't yet reproduce the issue

To run, "type": "module" must be added to the babel plugin inside node_modules after npm install.

steps to run:

git clone git@github.com:trusktr/solid-styled.git
cd solid-styled/
git checkout solid-styled-issue-2
npm i && npm run build

It will end with the error:

SyntaxError: Cannot use import statement outside a module
    at Object.compileFunction (node:vm:353:18)
    at wrapSafe (node:internal/modules/cjs/loader:1040:15)
...

Then

  • edit node_modules/babel-plugin-solid-styled/package.json and node_modules/solid-styled/package.json and add "type": "module" to both of them,
  • run npm run build

and now the build passes, but unfortunately this simple example doesn't yet reproduce the Missing StyleRegistry error.

This should probably be solved now?

  • solid-styled already ships with "type": "module"
  • solid-styled's StyleRegistry is now optional

Since there's lack of updates, and I positively believe this has been already fixed, I'll close this issue.