NativeScript / NativeScript/nativescript-cli

Using sass (dart-sass) with css2json-loader acts weird and crashes the app

Open
#5,257 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
1.1k
Forks
204
Avg merge
1d 9h
Merged PRs (30d)
8

Description

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 6.4.x (probably happens on older)
  • Cross-platform modules: 6.4.x (same)
  • Android Runtime: 6.4.x
  • iOS Runtime: 6.4.x

Describe the bug
An app with SCSS that is handled with sass implementation (dart-sass) and then served through css2json-loader produces code in the form of "undefinedundefined" inside bundle.js, just after the css2json produced code and app crashes on startup. Removing the css2json-loader and using css-loader works normal. Changing Webpack to 4.40.x produces several pages filled with "undefinedundefinedundefined...".

To Reproduce
Use the provided project and try to run it.

Expected behavior
To run.

Sample project
css2json-loader_sass_issue.zip

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided css2json-loader_sass_issue.zip sample with the listed NativeScript versions and the dart-sass pipeline. Inspect bundle.js around the css2json-generated code and compare the result with css-loader; done means the sample app starts without the undefined text or crash.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, sass, webpack
Domain
build-system, cli, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.