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

fix: change reference from open-next to @opennextjs/aws #529

Merged
merged 9 commits into from
Oct 2, 2024

Conversation

sommeeeer
Copy link
Contributor

@sommeeeer sommeeeer commented Oct 2, 2024

change reference from open-next to @opennextjs/aws in every
package.json in the example repos. let me know if anything else needs to change.

Copy link
Collaborator

@conico974 conico974 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/opennextjs/opennextjs-aws/actions/runs/11139867869/job/30957412300?pr=529
You'll need to update the lockfile as well, otherwise it will fail the linting, and probably a bunch of other stuff

@sommeeeer
Copy link
Contributor Author

sommeeeer commented Oct 2, 2024

The build failed on example/ after updating the pnpm version to 9. For some reason it was not creating its own node_modules folder. Might be a bug with pnpm itself, as I was not able to build the example/ locally either.

The error was: TypeError: Cannot read properties of null (reading 'useContext') at exports.useContext (/home/runner/work/opennextjs-aws/opennextjs-aws/node_modules/styled-jsx/node_modules/react/cjs/react.production.min.js:24:495)

Changing the next version down one patch-version made it work when trying locally.

Trying to revert the pnpm version now

@khuezy
Copy link
Collaborator

khuezy commented Oct 2, 2024

If there are different package versions across multiple apps, pnpm may get confused and cause problems.

@khuezy
Copy link
Collaborator

khuezy commented Oct 2, 2024

There's also: https://github.com/opennextjs/opennextjs-aws/blob/main/examples/app-router/package.json#L17C5-L17C32
Sorry, wrong link.
Why doesn't pages-router have the open-next dependency?

@conico974
Copy link
Collaborator

If there are different package versions across multiple apps, pnpm may get confused and cause problems.

Yeah but it should fail everywhere, not just on the example package. And keeping it on the old lockfile seems to do the trick

@conico974
Copy link
Collaborator

There's also: https://github.com/opennextjs/opennextjs-aws/blob/main/examples/app-router/package.json#L17C5-L17C32 Sorry, wrong link. Why doesn't pages-router have the open-next dependency?

I'm not even sure why there is a dep on open-next. It seems that it's not even used

@khuezy
Copy link
Collaborator

khuezy commented Oct 2, 2024

Yea, I'm not sure why it's a dep either. A mistake a long time ago? The examples/ app builds open next internally via node ../../packages/open-next/dist/index.js build

@conico974
Copy link
Collaborator

We can keep it for now, this would allow us to type the config file properly and maybe later add some custom adapter.
That would be great to add this in the e2e test as well

@conico974
Copy link
Collaborator

Btw i think we should probably add a line here

"open-next": "./dist/index.js"

I think right now it won't work with npx, we'll need to add "@opennextjs/aws": "./dist/index.js"
We should keep the open-next one for compatibility for people who install open-next locally

Copy link
Collaborator

@conico974 conico974 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM Thanks!!

@conico974 conico974 merged commit 0e26180 into opennextjs:main Oct 2, 2024
1 check passed
@khuezy
Copy link
Collaborator

khuezy commented Oct 2, 2024

> node ../../packages/open-next/dist/index.js build --streaming --build-command "npx turbo build"

node:internal/modules/cjs/loader:1080
  throw err;
  ^

Error: Cannot find module '/home/runner/work/opennextjs-aws/opennextjs-aws/packages/open-next/dist/index.js'

Hmm this is strange, did the folder structure change at all when this was migrated to the new org?

@conico974
Copy link
Collaborator

conico974 commented Oct 2, 2024

@khuezy Found it it's the --filter just before in the github actions
It doesn't build open-next at all

@khuezy
Copy link
Collaborator

khuezy commented Oct 2, 2024

Great catch! Easy to miss that step,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants