sapper-with-postcss-and-tailwind icon indicating copy to clipboard operation
sapper-with-postcss-and-tailwind copied to clipboard

npm run dev: Entry module "src/server.js" is implicitly using "default" export mode

Open pascalandy opened this issue 3 years ago • 2 comments

It's just annoying :-p. You can see my fork here.

Thanks for all the work!

npm run dev

> [email protected] dev /Volumes/ssg_sapper
> run-p watch:*

> [email protected] watch:css /Volumes/ssg_sapper
> postcss src/assets/global.pcss -o static/global.css -w

> [email protected] watch:dev /Volumes/ssg_sapper
> sapper dev

• server
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.
✔ client (5.6s)
> Listening on http://localhost:3000

pascalandy avatar Jan 06 '21 05:01 pascalandy

@pascalandy Does your fork fix it? I took a look at your commits and I don't think it does. Let me know if I am wrong.

I figured out how to stop the error, but I am not sure if setting it to 'default', which is what I did, is the correct solution.

To disable it, in rollup.config.js set the indicated line to be as written below.

export default {
client: {...},
server: {
	input: config.server.input(),
       // this line will fix the error. 
	output: {...config.server.output(), exports: 'default'},
...

https://github.com/thgh/vercel-sapper/issues/54#issuecomment-741022512

b-d-m-p avatar Jan 11 '21 11:01 b-d-m-p

Oh yes thanks! I fixed it in my branch 'edge'. We have the same fix :)

pascalandy avatar Jan 11 '21 16:01 pascalandy