tqwewe/emotion-solid

Error running locally

otakustay opened this issue · 4 comments

I was preparing to contribute some features to this package but encountered some issues.

I've forked this repo and tried to add a simple demo in it, however when my demo component uses import { styled } from '../src' it fails to run with a console warnign:

Uncaught TypeError: Cannot read properties of undefined (reading 'as')

Corresponding code is at line 82 of base.tsx:

When I build this package first and change my import statement to import { styled } from '../dist/index.esm.js' it works without any issue.

Not sure why the unbuilt version is crashing so I have to ask here. My fork is here: https://github.com/otakustay/emotion-solid

Hm that's strange, it sounds like it's trying to parse typescript as JavaScript.. I'll have a look into this today

I tried deleting yarn.lock and have a fresh install, with disabling hot reload in vite.config.ts it works, still figuring out why hot reload crashes it.

It seems a bug inside solid-js, I've created an issue to track it: https://github.com/solidjs/solid/issues/744

Ah okay thank you for getting onto this!