-
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
there is no mapping for this bare specifier #60
Comments
Hello, I just tried to create a project from scratch with the following files (and it works fine): project/
index.js
generate_importmap.mjs
package.json index.js import { LitElement, html } from "lit";
import { customElement, property } from "lit/decorators.js";
import { classMap } from "lit/directives/class-map.js";
import { animate } from "@lit-labs/motion"; generate_importmap.mjs: import { writeImportMapFiles } from "@jsenv/importmap-node-module";
await writeImportMapFiles({
projectDirectoryUrl: new URL("./", import.meta.url),
importMapFiles: {
"./project.importmap": {
mappingsForNodeResolution: true,
entryPointsToCheck: ["./index.js"],
},
},
}); package.json: {
"name": "toto",
"type": "module",
"dependencies": {
"@lit-labs/motion": "^1.0.3"
}
} > node ./generate_importmap.mjs
-> /Users/d.maillard/dev/jsenv/importmap-node-module/tests/toto/project.importmap |
Thank you. Let me follow your template and try again |
hi, I have couple questions.
SyntaxError: C:\MyDevProjects\MySandbox\SkateboardVideoPlatform\WebComponents\Skate.UI.Webc\http:\jsenv.com\wwwroot\main-layout-css-tester.js: Support for the experimental syntax 'importAssertions' isn't currently enabled (16:3): 14 | const cssModule = await import('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap', {
Add @babel/plugin-syntax-import-assertions (https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-import-assertions) to the 'plugins' section of your Babel config to enable parsing. |
Wonderful, this is the way to go
🤔 I think it's because in your file structure you have something like that:
And when generating importmap you pass The fix is likely to copy babel config file into the |
And you need |
To improve things I'll publish a new version with the following changes:
|
fyi, I don't direclty use babel. I don't use any bundler, just plain Typescript. my package.json my browser import map --> |
I have changed package.json and did an update - New error:
|
I'll try your setup and see what is going on |
Ok I just tried lit + typescript and got something working. The files involved are here: You end up with Hot fix is to add a name to your root package.json. |
I get the following error:
`file:///C:/MyDevProjects/MySandbox/webc-lit-rcl-pkg/web-lit-rcl/wwwroot/motion-slide.js:10:24
9 | import { classMap } from 'lit/directives/class-map.js';
Source: File (works perfectly with bundler)
import { LitElement, html } from 'lit'; import { customElement, property } from 'lit/decorators.js'; import { classMap } from 'lit/directives/class-map.js'; import { animate } from '@lit-labs/motion'; import style from './motion-slide.lit.js';
The text was updated successfully, but these errors were encountered: