Comments (9)
Hi @JonasKruckenberg ,
I created a reduced case and the metadata import worked perfectly.
I went back to my project and... It worked perfectly.
The issue is resolved.
Sorry for the misleading report, and thanks for your help!
from imagetools.
What version of the plugin are you using? 3.1.0 or 3.4.0-next.3 ?
If you're not using 3.4.0-next.3
please check out the latest version from npm with npm install vite-imagetools@next
and let me know if the issue is still present (Since @next
is close to being released)
from imagetools.
Because in version 3.1.0 the plugins usage of named exports (so that each property of the object also gets exported individually) is determined by the json.namedExports
setting in your Vite-config (This option is true
by default though)
In version 3.4.0-next.3
json.namedExports
is still ignored, but considered a regression, so it will come back with 3.4.0-next.4
!
from imagetools.
Hi Jonas,
I was using version 3.1.0
, indeed.
I tried to use the 3.4.0-next.4
, but I receive another error, and I could not test it.
failed to load config from /Users/davide/Documents/Code/svelte-vite/vite.config.js error when starting dev server: TypeError: (0 , import_vite_imagetools.imagetools) is not a function
from imagetools.
Alright, after fighting the monorepo build setup for the weekend, I got a new version released 3.4.0-next.5
that should hopefully address this issue! Can you confirm the problem is gone @davidelanfranchi?
from imagetools.
Hi @JonasKruckenberg,
I just tried (3.4.0-next.7
) and the destructured import works, but I had to explicitly set Vite json.namedExports
setting as true
.
OIn the contrary, I receive the same error, The requested module [...] does not provide an export named [...]
.
from imagetools.
I just tried (
3.4.0-next.7
) and the destructured import works, but I had to explicitly set Vitejson.namedExports
setting astrue
.
This is weird, this should not be necessary since the json.namedExports options is true
by default. https://vitejs.dev/config/#json-namedexports
OIn the contrary, I receive the same error,
The requested module [...] does not provide an export named [...]
.
What import are we talking about? Importing the plugin in you config object or importing an image with metadata?
from imagetools.
I'm talking about the image with metadata (&meta
directive).
I tried to set json.namedExports
, although the default is true
, because of your first answer, and it worked.
from imagetools.
Alright yeah, it should work without explicitly setting that option too. I tried the svelte starter app as well, but I cannot reproduce the missing named import warning. Can you maybe share a reproduction or a code snippet showing how you imported the image?
from imagetools.
Related Issues (20)
- Query strings don't work in dynamic imports with template literals containing variables HOT 8
- Upgrading to Vite 4.4.0 broke vite-imagetools HOT 5
- imagetools-core 4.0.4 `resolveConfigs` behavior change, `format` directive no longer working
- Build and build -w output differs HOT 6
- as=source and as=srcset both outputting srcset with all the same width params HOT 3
- manifest.json is generated incorrectly HOT 2
- Upgrading Vite-imagetools 5.0.8 throws an error from 4.x version HOT 2
- generateImageID causes tests to fail on CI HOT 3
- Vite example has a typo HOT 1
- Renaming picture fallback to img is not reflected in the document HOT 1
- Waste less effort transforming images
- Dependency on sharp not declared correctly for yarn’s PnP loader HOT 9
- Vite plugin crash HOT 2
- Loading attribute HOT 1
- v6 broken due to missing sharp 0.33 binariers HOT 3
- Some images get rotated for some reason HOT 14
- crop from / "gravity" HOT 1
- Error: Unable to parse color from string: ##ffaa22
- Pre-transform error: Failed to parse source for import analysis because the content contains invalid JS syntax
- How to receive access to original image in `extendOutputFormats` after v7.0.0? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imagetools.