hardhat-ignition icon indicating copy to clipboard operation
hardhat-ignition copied to clipboard

Artifact naming convention incompatible with vite

Open kanej opened this issue 1 year ago • 2 comments

We export artifacts based on the future id, which includes the # symbol as a separator:

image

When imported via vite it fails to resolve the import:

[vite] Internal server error: Failed to resolve import ...

This was first raised on discord: https://discord.com/channels/750408878008827925/1153426756901032037/1234168682490364017

kanej avatar Apr 29 '24 10:04 kanej

Looking at vite, they seem to have made the call not to support # in file paths:

https://github.com/vitejs/vite/issues/13123

kanej avatar Apr 29 '24 10:04 kanej

I think we should consider adding an hre.ignition.getArtifact or hre.artifacts.readIgnitionArtifact or similar to hardhat v3

Maybe even a separate utility function not attached to anything, in case a user doesn't want to import the entire hre just for that function

zoeyTM avatar Jun 03 '24 03:06 zoeyTM