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

[Bug] Stringify remove spaces and new lines from template literal #81

Open
ryuran opened this issue Jun 6, 2022 · 0 comments
Open

[Bug] Stringify remove spaces and new lines from template literal #81

ryuran opened this issue Jun 6, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@ryuran
Copy link

ryuran commented Jun 6, 2022

Describe the bug

Stringify unexpectedly remove spaces and new lines from template literal

Steps to reproduce the behavior

stringify({
  f: () => `
    1
    2
    3
  `,
})

result :

{"f":"_function_f|() => `123`"}

Expected result

{"f":"_function_f|() => `\n    1\n    2\n    3\n  `"}

Environment

  • OS: macOS
  • Node.js version: v14.16.1
  • NPM version: v7.24.2
  • Browser (if applicable): chrome, firefox…
  • Browser version (if applicable): firefox 101.0, chrome 102.0.5005.61

Additional context

Telejson is used under the hood of storybook and fail to "teleport" function containing template literal without loosing spaces and new line in webpack devServer environement.

@ryuran ryuran added the bug Something isn't working label Jun 6, 2022
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

1 participant