Closed zwergius closed 3 years ago
Looks like you updated Rollup but not Sapper, the errors stems from rollup.config.js
:
Hi again,
I do have latest Sapper 0.28.3 and everything else updated to latest versions as well.
This warning appears when adding export default to "src/server.js" as described in the docs
@thgh I don't understand if we're supposed to add "exports": "default"
to the client object or as a param to the output() method. Either way doesn't seem to work, and I'm having the same issue as the others. Could you please re-open the issue?
It should be a property of the output object: https://rollupjs.org/guide/en/#outputexports
I see.. Yeah, you're correct. Except it should be added to the output object under the server config, not the client. This seems to make the issue go away.
export default {
client: {...},
server: {
input: config.server.input(),
output: {...config.server.output(), exports: 'default'},
...
@TheSimpleZ Thanks for figuring it out, that makes way more sense 😛
Sidenote: another option is to write module.exports =
instead of export default
Since updating sapper I've been getting this warning:
Entry module "src/server.js" is implicitly using "default" export mode, which means for CommonJS output that its default export is assigned to "module.exports". For many tools, such CommonJS output will not be interchangeable with the original ES module. If this is intended, explicitly set "output.exports" to either "auto" or "default", otherwise you might want to consider changing the signature of "src/server.js" to use named exports only.