We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
npm
Mac
I want to publish a component package for Astro. Its usage would look like this:
--- import Icon from '@example/Icons' --- <Icon.ZoomIn />
The @example/Icons package would resolve to an Icons.astro file that looks like this:
@example/Icons
Icons.astro
--- import Height from './Height.astro' import Width from './Width.astro' import ZoomIn from './ZoomIn.astro' import ZoomOut from './ZoomOut.astro' const Icon = { Height, Width, ZoomIn, ZoomOut, } export default Icon export { Height, Width, ZoomIn, ZoomOut } ---
Unfortunately, this use of export throws the following error.
SyntaxError: [66:6]: The export keyword can only be used with the module goal
Preview
https://codesandbox.io/s/github/jonathantneal/astro-radix-icons
Is this a bug? How else might I do this?
git clone https://github.com/jonathantneal/astro-radix-icons
cd astro-radix-icons
npm install
npm start
https://github.com/jonathantneal/astro-radix-icons
The text was updated successfully, but these errors were encountered:
Can you try doing so in a regular js/ts file?
Sorry, something went wrong.
https://github.com/snowpackjs/astro/blob/main/packages/astro/components/index.js
Ah yeah, I didn't notice that, but we don't currently support exporting from .astro files at all.
.astro
This was attempted in #619, now there's #1142 as an RFC to make this possible. So going to close as a dupe, even though it definitely is an issue.
No branches or pull requests
What package manager are you using?
npm
What operating system are you using?
Mac
Describe the Bug
I want to publish a component package for Astro. Its usage would look like this:
The
@example/Icons
package would resolve to anIcons.astro
file that looks like this:Unfortunately, this use of export throws the following error.
Preview
https://codesandbox.io/s/github/jonathantneal/astro-radix-icons
Is this a bug? How else might I do this?
Steps to Reproduce
git clone https://github.com/jonathantneal/astro-radix-icons
cd astro-radix-icons
npm install
npm start
SyntaxError: [66:6]: The export keyword can only be used with the module goal
Link to Minimal Reproducible Example (Optional)
https://github.com/jonathantneal/astro-radix-icons
The text was updated successfully, but these errors were encountered: