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

Where is my entrypoint.js #216

Open
escobar5 opened this issue May 25, 2022 · 4 comments
Open

Where is my entrypoint.js #216

escobar5 opened this issue May 25, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@escobar5
Copy link

Describe the bug
I have a workspace with this structure:

  • packages
    • core
    • api

api depends on core.

when I run yarn bundle inside api, everything works fine, and bundle.zip is created, but inside, there is no signs of entrypoint.js.

To Reproduce
Steps to reproduce the behavior:

  1. Run command 'yarn bundle'
  2. Open bundle.zip
  3. See entrypoint.js missing

Expected behavior
As the documentation states, there should be a file called entrypoint.js

Desktop (please complete the following information):

  • OS: macOS Monterrey 12.3.1
@escobar5 escobar5 added the bug Something isn't working label May 25, 2022
@ojkelly
Copy link
Owner

ojkelly commented May 26, 2022

It looks for "main" in package.json of the workspace your bundling, as it needs to re-export that.

@escobar5
Copy link
Author

escobar5 commented May 26, 2022

The workspace I'm bundling has: "main": "./dist/main.js",, should entrypoint.js be created? or am I missing something?

@ojkelly
Copy link
Owner

ojkelly commented May 26, 2022

Nope that's correct.

entrypoint.js is meant to be added to the very top level of the zip. This is so you don't need to encode the whole path to your script, in particular for Lambda which expects to be able to import a file at the top folder.

Can you confirm if it's in the top folder, and if not would you mind creating a stripped down repo that reproduces it?

additionally, if you're running this in something like docker, you can run the command yarn workspace api start presuming your package is named api and there is a script start, and that will start your package. You can also cd to the right directory and run it.

@escobar5
Copy link
Author

Ok, I will try to reproduce it on an empty project, I'm good with executing the project with yarn workspace start, I was just curious about that file.

Thanks

@ojkelly ojkelly closed this as completed May 27, 2022
@ojkelly ojkelly reopened this May 27, 2022
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