tqwewe / emotion-solid

Emotion JS support for Solid JS projects
https://www.npmjs.com/package/emotion-solid
MIT License
42 stars 4 forks source link

Error running locally #2

Closed otakustay closed 2 years ago

otakustay commented 2 years ago

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

tqwewe commented 2 years ago

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

otakustay commented 2 years ago

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.

otakustay commented 2 years ago

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

tqwewe commented 2 years ago

Ah okay thank you for getting onto this!