question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem importing the metadata object

See original GitHub issue

Hi @JonasKruckenberg , I’m trying the plugin with a basic Vite + Svelte setup, scaffolded with @vite/create-app. Thank you for your work, it’s wonderful and it works well.

I encountered this issue using the metadata directive.

With this code: import {src, width, height} from "$assets/images/usgs-AQ9-jKmebjM-unsplash.jpg?width=375&meta";

I get this error in console: Uncaught SyntaxError: The requested module '/src/assets/images/usgs-AQ9-jKmebjM-unsplash.jpg?import&width=375&meta' does not provide an export named 'height'

Nonetheless, if I import as a single module the image: import Meta from "$assets/images/usgs-AQ9-jKmebjM-unsplash.jpg?width=375&meta";

I get the correct metadata object. //console.log(Meta); { "format": "jpeg", "width": 375, "height": 375, "channels": 3, "premultiplied": false, "size": 49715, "src": "node_modules/.cache/vite-imagetools/tmp/47fa4256/usgs-AQ9-jKmebjM-unsplash.jpeg" }

It’s not a big deal, but it’s something worth knowing, or maybe you have any hint about it. I’m using the plugin with the force option as true, and the silent option as false.

✌️

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
davidelanfranchicommented, Apr 12, 2021

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!

0reactions
JonasKruckenbergcommented, Apr 12, 2021

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?

Read more comments on GitHub >

github_iconTop Results From Across the Web

SAS returns an error when importing metadata package files
This error is likely to occur if the package contains objects other than tables that have an association to a library.
Read more >
Problem importing Oracle metadata via Information Analyzer
Problem Description: Attempts to import table definitions via InformationAnalyzer fail due to multiple keys named the same in different tables or in different ......
Read more >
Errors when importing metadata file into OWB - mdl1406 ...
The error occurs when I import a metadata file into OWB 10.2. It appears to be a problem with the location but this...
Read more >
Solved: Metadata won't import - Esri Community
Solved: I'm using ArcGIS 10.2.2 in Win7 and have never been able to import or update metadata. I've tried on two different machines...
Read more >
Error in when Debugging file import in C/AL #5101 - GitHub
Go to Budgets page (page 113), and press "Import from File". Error message will read "The metadata object Page 81 was not found."....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found