Skip to content

When using a typed amplify project (.ts) plugin crashes due to trying to load aws-exports.ts instead of aws-exports.js #39

@abarbatei

Description

@abarbatei

Plugin normal functionality needs to read the aws-exports for a variety of reasons.

amplify-graphql-seed-plugin attempts to read any aws export files identified via the ${srcFolder}/**/aws-exports.* regex.

If the current amplify project is typed (uses type TypeScript) a src/aws-exports.d.ts file will be generated.
Example of our project:

aws-exports.d.ts
aws-exports.js

This means that the plugin attempts to import a .ts file and crashes with Invalid or unexpected token.
image

The Invalid or unexpected token error is from line 84 in the same utils/directory-functions::getAwsExports function:

    return require(awsExportsFile).default

Please modify the file system regex to exclude .ts files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions