You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This results, in my IDE where CONNECTION_STATE_CHANGE is referenced, in this error:
TS1362: CONNECTION_STATE_CHANGE cannot be used as a value because it was exported using export type
index.d.ts(4, 49): CONNECTION_STATE_CHANGE was exported here.
And results in the error in the launched app:
Uncaught SyntaxError: The requested module '/node_modules/.vite/deps/aws-amplify_api.js?v=c267a91d' does not provide an export named 'CONNECTION_STATE_CHANGE' (at subscriptions.ts:2:10)
Expected behavior
That the import statement will not throw a syntax error, per the documentation referenced in the bug description, and instead provide the const exported not-as-a-type elsewhere in the amplify codebase.
// Put your code below this line.import{CONNECTION_STATE_CHANGE,ConnectionState}from"aws-amplify/api";// ...Hub.listen("api",(data: any)=>{// eslint-disable-next-line @typescript-eslint/no-unsafe-assignmentconst{ payload }=data;if(payload.event===CONNECTION_STATE_CHANGE){// ...
@timheilman, thank you for opening this issue and submitting a PR already for it. I'll review both of these with the team and report back soon. Appreciate you taking the time to call this out and help!
@timheilman, the fix for this was released on 01/04/24 with v6.0.10. Please upgrade to the latest version and let us know if you experience any further issues! Thanks.
Before opening, please confirm:
JavaScript Framework
Not applicable
Amplify APIs
GraphQL API
Amplify Categories
api
Environment information
Describe the bug
Following the v6 documentation for AppSync GraphQL subscription connection updates I use the import as indicated:
This results, in my IDE where CONNECTION_STATE_CHANGE is referenced, in this error:
And results in the error in the launched app:
Expected behavior
That the import statement will not throw a syntax error, per the documentation referenced in the bug description, and instead provide the const exported not-as-a-type elsewhere in the amplify codebase.
Reproduction steps
Follow the v6 documentation for AppSync GraphQL subscription connection updates.
Code Snippet
Log output
aws-exports.js
not applicable
Manual configuration
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
I have a PR that exports the constant as a constant rather than as a type, with a new unit test, ready to submit.
The text was updated successfully, but these errors were encountered: