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

Package subpath './http' is not defined by "exports" in /workspace/node_modules/@sveltejs/app-utils/package.json #12

Closed
jdgamble555 opened this issue Feb 10, 2021 · 6 comments · Fixed by #15
Assignees
Labels
bug Something isn't working released

Comments

@jdgamble555
Copy link

It seems the latest version 1.0.0-next.1 changed the way it exports. It seems to be a problem with:

const {get_body: getBody} = require('@sveltejs/app-utils/http');

in handler.js

@jthegedus
Copy link
Owner

jthegedus commented Feb 11, 2021

Thanks for raising this, I will take a look. Please continue to raise issues with new versions or that you encounter with the ergonomics of this tool.

Just so we're on the same page, I'm getting the version #s with:

npm show @sveltejs/kit versions`

and looking through the changelog for updates. I am only doing this about once a week as development on SvelteKit is going a bit slower than expected, but which I appreciate because it's shaping up well.

The 3 new versions since I last tested this are:

  • 1.0.0-next.32
  • 1.0.0-next.33
  • 1.0.0-next.34

I'm going to add the "validated with" version in the README so people know which version to pin to that this adapter will work with.

@jthegedus jthegedus self-assigned this Feb 11, 2021
@jthegedus jthegedus added the bug Something isn't working label Feb 11, 2021
@jthegedus
Copy link
Owner

After looking at the updates I see you were talking about @@sveltejs/app-utils@1.0.0-next.1

@jthegedus
Copy link
Owner

It seems the app-utils package is ESM only(?) now. Error when changing to ES module import syntax

 import {get_body: getBody} from '@sveltejs/app-utils/http' ^^^^^^ SyntaxError: Cannot use import statement outside a module at wrapSafe (internal/modules/cjs/loader.js:1052:16) at Module._compile (internal/modules/cjs/loader.js:1100:27) at Module._compile (pkg/prelude/bootstrap.js:1281:32) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1156:10) at Module.load (internal/modules/cjs/loader.js:984:32) at Function.Module._load (internal/modules/cjs/loader.js:877:14) at Module.require (internal/modules/cjs/loader.js:1024:19) at Module.require (pkg/prelude/bootstrap.js:1225:31) at require (internal/modules/cjs/helpers.js:72:18)

I am no esm expert, especially when it comes to Node.js environments. This was on a Node.js 14.15.3 Firebase emulator Function, I will have to investigate further 🤔

@jthegedus
Copy link
Owner

jthegedus commented Feb 11, 2021

When the node adapter moves it's latest tag I will address this.
https://www.npmjs.com/package/@sveltejs/adapter-node
Screenshot from 2021-02-12 07-55-08

In the meantime, please use @sveltejs/kit@1.0.0-next.31, .33 may work, but I have not tested it

@jthegedus
Copy link
Owner

This still won't actually work, but for different reasons, see #16

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2021

🎉 This issue has been resolved in version 0.3.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging a pull request may close this issue.

2 participants