web icon indicating copy to clipboard operation
web copied to clipboard

dev-server fail when importing css

Open jogibear9988 opened this issue 4 years ago • 2 comments

the hosting with web dev server fails on my machine with the following error:

      Error while transforming node_modules/@node-projects/web-component-designer/dist/elements/widgets/codeView/code-view-code-mirror.js: Could not resolve import "codemirror/lib/codemirror.css".
      
        21 |         super();
        22 |         //@ts-ignore
      > 23 |         import("codemirror/lib/codemirror.css", { assert: { type: 'css' } }).then(x => this.shadowRoot.adoptedStyleSheets = [x.default, this.constructor.style]);
           |        ^

jogibear9988 avatar Jan 10 '22 20:01 jogibear9988

I might be having the same problem. I just went from 0.1.28 to 0.1.29 and things broke. I'm not using Typescript, so the problem is a bit easier to track.

In my files named mystyle.css.js, I typically import without the .js file extension.

This worked in 0.1.28: import { style } from './app.css

But now in 0.1.29, it only works if I do: import { style } from './app.css.js

bengfarrell avatar Feb 01 '22 06:02 bengfarrell

I might be having the same problem. I just went from 0.1.28 to 0.1.29 and things broke. I'm not using Typescript, so the problem is a bit easier to track.

In my files named mystyle.css.js, I typically import without the .js file extension.

This worked in 0.1.28: import { style } from './app.css

But now in 0.1.29, it only works if I do: import { style } from './app.css.js

So weird, I guess I'll retract my comment. It's the next day and I was curious to debug and see what was happening, and now it's not broken. I'm certain I was switching between these two and saw this behavior, but where this fluke came from, I can't say. I'll keep an eye out and thanks for the great work/tooling!

bengfarrell avatar Feb 01 '22 16:02 bengfarrell