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

PostCSS preprocessing breaks with Svelte versions 3.30.0+ #3

Closed
arggh opened this issue Jul 23, 2021 · 1 comment · Fixed by #4
Closed

PostCSS preprocessing breaks with Svelte versions 3.30.0+ #3

arggh opened this issue Jul 23, 2021 · 1 comment · Fixed by #4

Comments

@arggh
Copy link

arggh commented Jul 23, 2021

If I try to define PostCSS plugins when using Svelte version 3.30.0 or later, the build crashes on few different errors, depending on the Svelte version. This error is one of them:

/Users/arggh/.meteor/packages/coffeescript/.1.0.17.jzhn4e.2mhnq++os+web.browser+web.cordova/plugin.compileCoffeescript.os/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:116
      throw error;
      ^

TypeError: processed.code.replace is not a function
    at parse_attached_sourcemap (/Users/arggh/Develop/app/node_modules/svelte/src/compiler/utils/mapped_code.ts:305:34)
    at processed_tag_to_code (/Users/arggh/Develop/app/node_modules/svelte/src/compiler/preprocess/index.ts:111:2)
    at process_single_tag (/Users/arggh/Develop/app/node_modules/svelte/src/compiler/preprocess/index.ts:168:10)

Reproduction: https://github.com/arggh/meteor-melte-version-issue/

@arggh
Copy link
Author

arggh commented Jul 23, 2021

Currently melte-compiler uses the full return value from postcss as value of code in style preprocessor return value. That used to work, for some reason, before Svelte 3.30.0, but not anymore.

eg.

{
  code: { css: '.example { ... }', postcssStuff, fileInfo etc. }
}

Pull request #4 fixes this by using only the raw css value as value of code.

eg.

{
  code: '.example { ... }'
}

@zodern zodern closed this as completed in #4 Jul 23, 2021
zodern added a commit that referenced this issue Jul 23, 2021
…on-compat

#3 Fix style preprocessing with Svelte versions 3.30.0 and beyond
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant