-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
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
Getting ReferenceError: process is not defined
when attempting to import Schema
into Astro React component
#13729
Comments
Just solved this I think, the issue seems to be the syntax import { type Schema } from "amplify/data/resource"; // <-- Throws an error
import type { Schema } from "amplify/data/resource"; // <-- Works Not sure if its something specific to astro, as I haven't had this issue before and Im relatively new to astro |
Hey,👋 thanks for raising this! I'm going to transfer this over to our API repository for better assistance 🙂 |
Adding tsconfig {
"extends": "astro/tsconfigs/strict",
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "react",
"baseUrl": ".",
"paths": {
"@/*": [
"./src/*"
]
}
}
} |
While I'm not able to reproduce this in a That being said this should be removed when @nadetastic does this occur with |
@josefaidt Nope that doesn't throw an error - seems specific to react components, haven't tried Vue/others |
Going to mark this as a bug for now since it's consistently reproducible. I couldn't find any existing bugs in the Astro repo or elsewhere. Seems unique to react components in Astro at the moment. But, while it's a runtime issue, it doesn't seem to be related to data-schema. So, i'm going to transfer this to the JS repo. |
Closing this issue as it's not Amplify related, but rather on the Astro side of things. We'll monitor Astro repo for a related bug and cross link. |
Environment information
Description
I'm trying out Astro with Amplify Gen2 and came across an error when attempting to import the Schema from
defineData
into a React component in AstroHere are my components
todo/[...slug].astro
TodoCard.tsx
With this I get the following error in the browser console
The text was updated successfully, but these errors were encountered: