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

SyntaxError: Non-default export is not supported in main.js:20 #1

Closed
duffn opened this issue Oct 2, 2021 · 4 comments
Closed

SyntaxError: Non-default export is not supported in main.js:20 #1

duffn opened this issue Oct 2, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@duffn
Copy link

duffn commented Oct 2, 2021

Hello,
Thank you for the nice starter. I'm attempting to run the project and after having installed dependencies and building, receive this error when running npm run start.
Thanks for any help.

$ npm -v
7.13.0
$ node -v
v16.2.0
$ npm run start

> njs-typescript-starter@0.0.0 start
> run-p watch start-nginx


> njs-typescript-starter@0.0.0 watch
> rollup -c --watch --no-watch.clearScreen


> njs-typescript-starter@0.0.0 start-nginx
> start-nginx --version 1.19.x --port 8090 --watch dist/ integration-tests/nginx.conf

rollup v2.58.0
bundles src/index.ts → dist/main.js...
nginx-binaries: Downloading https://jirutka.github.io/nginx-binaries/nginx-1.19.10-x86_64-darwin...
created dist/main.js in 280ms

[2021-10-02 13:42:42] waiting for changes...
nginx-testing: Starting nginx 1.19.10 on port(s): 8090
2021/10/02 13:42:42 [warn] 2989#1792475: the "ssl" directive is deprecated, use the "listen ... ssl" directive instead in /Users/duffy/code/njs-typescript-starter/integration-tests/.nginx.conf~:10
2021/10/02 13:42:42 [emerg] 2989#1792475: SyntaxError: Non-default export is not supported in main.js:20
nginx-testing: Failed to start nginx, no response on port 8090
ERROR: "start-nginx" exited with 1.

My main.js file is generated like this:

/*!
* ${njs-typescript-starter} ${a56bd527ed489308c512e11f71a747a846f00686}
* 
* Date: 2021-10-02
* */
import qs from 'querystring';

function hello(r) {
  var name = r.args.name ? qs.unescape(r.args.name) : 'world';
  return r.return(200, `
    Meow, ${name}!

        ("\`-''-/").___..--''"\`-._
        \`6_ 6  )   \`-.  (     ).\`-.__.\`)
        (_Y_.)'  ._   )  \`._ \`. \`\`-..-'
      _..\`--'_..-_/  /--'_.' ,'
      (il),-''  (li),'  ((!.-'
  `);
}

var index = {
  hello
};

export { index as default };
@jirutka
Copy link
Owner

jirutka commented Oct 3, 2021

What exactly don’t you understand on the error message: SyntaxError: Non-default export is not supported in main.js:20?
It’s even mentioned in src/index.ts.

EDIT: Aha, I see now, you just built the example and it produces export { index as default };.

@duffn
Copy link
Author

duffn commented Oct 3, 2021

The starter is meant to generate a non-working project per the README instructions? All I've done is clone the project and attempt to run it per the README.

EDIT: Yes, I've only built the example.

@jirutka jirutka added the bug Something isn't working label Oct 3, 2021
@jirutka
Copy link
Owner

jirutka commented Oct 3, 2021

No, it’s not. I misunderstood your report. Sorry about it.

@jirutka
Copy link
Owner

jirutka commented Dec 28, 2021

This regression is caused by changes in rollup 2.55.0, specifically #4182.

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