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

fix(ssr): fix ssrTransform catch clause error (fix #2667) #2966

Merged
merged 2 commits into from
Apr 13, 2021

Conversation

leemove
Copy link
Contributor

@leemove leemove commented Apr 13, 2021

Description

#2667

vite ssrtransform can't work good with error catch

import {error} from ''./actionTypes.js''

try {
// something
} cache(error) {
}

after transform

const __vite_ssr_import_6__ = __vite_ssr_import__("/node_modules/xstate/es/actions.js")
try {
// something
} cache(__vite_ssr_import_6__.error) { //  SyntaxError: Unexpected token '.'

}

imp

Additional context


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@Shinigami92
Copy link
Member

@leemove Is it possible for you to add a test case in playground for that fix?

@leemove
Copy link
Contributor Author

leemove commented Apr 13, 2021

@leemove Is it possible for you to add a test case in playground for that fix?

sure

@GrygrFlzr GrygrFlzr changed the title fix(ssr): fix sstTransfrom catchclause error (fix #2667) fix(ssr): fix sstTransform catch clause error (fix #2667) Apr 13, 2021
@GrygrFlzr GrygrFlzr changed the title fix(ssr): fix sstTransform catch clause error (fix #2667) fix(ssr): fix ssrTransform catch clause error (fix #2667) Apr 13, 2021
@patak-dev patak-dev merged commit c9e0bcf into vitejs:main Apr 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SSR importing xstate with ssr.noExternal causes SyntaxError: Unexpected token '.'
3 participants