Closed George-Madeley closed 4 months ago
It's probably a duplicate of https://github.com/protomaps/protomaps-leaflet/issues/158.
By the way you can "simulate" a default export with everything like this:
import * as protomapsL from "protomaps-leaflet"
We need some way to reproduce your issue, which also depends on if your environment is CommonJS or ES Modules, what bundler you are using, TypeScript, etc. Can you create and share a minimal example?
Environment: CommonJS, Bundler: Webpack, Typescript: 4.7.4,
ts.config:
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx"
},
"include": ["src", "src/tabs/.tsx"]
}
Can you please try 4.0.0-alpha.0
v4.0.0 has been published - please reopen if you are still having this issue. https://www.npmjs.com/package/protomaps-leaflet
I cannot use leafletLayer or import anything from the protomaps-leaflet module as I am constantly getting import errors relating to the import extensions within the module
No default export exists so I cannot use:
When I try and import leafletLayer, I get the following error:
ERROR in ~/node_modules/protomaps-leaflet/dist/frontends/static.js 32:0-35 Module not found: Error: Can't resolve '../painter' in '~\node_modules\protomaps-leaflet\dist\frontends' Did you mean 'painter.js'? BREAKING CHANGE: The request '../painter' failed to resolve only because it was resolved as fully specified (probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '.mjs' file, or a '.js' file where the package.json contains '"type": "module"'). The extension in the request is mandatory for it to be fully specified. Add the extension to the request.
This is also repeated for: