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

rollup -c fails if rollup.config.js is a symlink #3781

Closed
milahu opened this issue Sep 15, 2020 · 3 comments · Fixed by #3783
Closed

rollup -c fails if rollup.config.js is a symlink #3781

milahu opened this issue Sep 15, 2020 · 3 comments · Fixed by #3783

Comments

@milahu
Copy link

milahu commented Sep 15, 2020

to reproduce:

mv rollup.config.js rollup.config.js.FILE
ln -s rollup.config.js.FILE rollup.config.js
rollup -c

Expected Behavior

read config via symlink

Actual Behavior

[!] SyntaxError: Cannot use import statement outside a module
/home/user/src/javascript/jsdom/jsdom/rollup.config.js.file:1
import commonjs from '@rollup/plugin-commonjs';
^^^^^^

SyntaxError: Cannot use import statement outside a module

env

  • Rollup Version: v2.23.0
  • Operating System (or Browser): linux
  • Node Version (if applicable): v14.5.0
@shellscape
Copy link
Contributor

Thanks for opening an issue. Citing the issue template:

Issues without minimal reproductions will be closed! Please provide a link to one by:

  1. Using the REPL at https://rollupjs.org/repl/, or
  2. Using the REPL.it reproduction template at https://repl.it/@rollup/rollup-repro
    (allows full use of all rollup options and plugins), or
  3. Provide a minimal repository link (Read https://git.io/fNzHA for instructions).
    These may take more time to triage than the other options.

Please add a reproduction and we'll be happy to triage further.

@milahu
Copy link
Author

milahu commented Sep 15, 2020

reproduction repo is here
https://github.com/milahu/rollup-bug-demo-config-symlink

symlink-ed configs are treated as commonjs files
so the es6 import x from 'y' fails

@lukastaegert
Copy link
Member

Thanks for taking the time. With your reproduction, it was easy to debug and find the root cause, fix at #3783.

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

Successfully merging a pull request may close this issue.

3 participants