Skip to content
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

bug: Can't use vite if you use the @aws/amazon-ecs-plugin-for-backstage package in your Backstage app #192

Open
kissmikijr opened this issue Jul 19, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@kissmikijr
Copy link

πŸ“œ Description

I encountered this bug when I wanted to switch my bundler in my Backstage frontend application from webpack to vite:

[0] ✘ [ERROR] Failed to resolve entry for package "@backstage/integration-aws-node". The package may have incorrect main/module/exports specified in its package.json. [plugin vite:dep-pre-bundle]

[0]   The plugin "vite:dep-pre-bundle" was triggered by this import
[0] 
[0]     ../../node_modules/@aws/amazon-ecs-plugin-for-backstage/node_modules/@aws/aws-core-plugin-for-backstage-common/dist/index.esm.js:3:45:
[0]       3 β”‚ ...aultAwsCredentialsManager } from '@backstage/integration-aws-node';

Looks like the issue is because the package @aws/aws-core-plugin-for-backstage-common has a dependency towards the package @backstage/integration-aws-node which is a node-library package (which is a backend type of package) but because the @aws/aws-core-plugin-for-backstage-common is a common package it is used in the frontend package: @aws/amazon-ecs-plugin-for-backstage So ultimately the backend package ends up in the frontend bundle and the bundler fails.

πŸ‘ Expected behavior

Cleanup the dependencies to not end up with backend code in the frontend plugins

πŸ‘Ž Actual Behavior with Screenshots

Right now some backend type of packages are getting bundled into the frontend and vite fails on them

πŸ‘Ÿ Reproduction steps

Add the plugin: @aws/amazon-ecs-plugin-for-backstage to your project's frontend package and try to start your frontend with the EXPERIMENTAL_VITE=1 flag

πŸ“ƒ Content

No response

πŸ–₯️ Your Environment

No response

@kissmikijr kissmikijr added the bug Something isn't working label Jul 19, 2024
@niallthomson
Copy link
Contributor

Hi @kissmikijr thanks for reporting this I'll take a look in to it

@niallthomson
Copy link
Contributor

I think we'll need to split the common package and add a node package to resolve this. I'll try to figure out how much effort this will be this week.

@niallthomson
Copy link
Contributor

I split the common package and published a new release. Can you let me know if this fixes the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants