Skip to content
This repository has been archived by the owner on Aug 13, 2024. It is now read-only.

SyntaxError: Unexpected identifier #55

Closed
lifenautjoe opened this issue Apr 25, 2016 · 4 comments
Closed

SyntaxError: Unexpected identifier #55

lifenautjoe opened this issue Apr 25, 2016 · 4 comments

Comments

@lifenautjoe
Copy link

Preconditions

  • node@5.11.0
  • jspm@0.17.0-beta.12
  • plugin-sass@0.4.3

Given

We have the following in jspm.config.js

SystemJS.config({
  transpiler: "plugin-typescript",
  packages: {
    "ng-kpn-check-box-alpha": {
      "main": "main.ts",
      "defaultExtension": "ts",
      "meta": {
        "*.ts": {
          "loader": "plugin-typescript"
        },
        "*.scss": {
          "loader": "scss"
        }
      }
    }
  }
});

We have a check-box-alpha.scss file within the package which contains the following

.what {
  background-color: red;
}

We have a CheckBoxAlpha.ts file next to the check-box-alpha.scss file with the following

import './check-box-alpha.scss';

Then

In our console we execute the following command

jspm bundle ng-kpn-check-box-alpha storage/build.js

Finally

In our console we see the following error

err  SyntaxError: Unexpected identifier
      at Object.exports.runInThisContext (vm.js:53:16)
  Evaluating /Users/joelhernandez/Documents/KPN/ng-kpn-check-box-alpha/jspm_packages/github/mobilexag/plugin-sass@0.4.3/sass-builder.js
  Error loading /Users/joelhernandez/Documents/KPN/ng-kpn-check-box-alpha/jspm_packages/github/mobilexag/plugin-sass@0.4.3/sass-builder.js
@screendriver
Copy link
Collaborator

  1. you are using jspm@0.17.0-beta.12 which is not released. It is still a beta and has bugs. Especially for plugins. Please use the latest stable version.
  2. you are importing wrong. Instead of import './check-box-alpha.scss'; you have to do a import './check-box-alpha.scss!';
  3. you are using TypeScript. Please look at Plugin uses ES6 syntax when installed #25 for a solution for that. jspm / SystemJS is based on ES5 / ES2015 and TypeScript as an optional plugin which causes issues with that.

@lifenautjoe
Copy link
Author

Alright, as a sidenote, the issue is raised because with plugin-sass@0.4.0 works, and in regards the importing wrong, this is not necessary with the meta *.scss wildcard on my systemJS config.

@screendriver
Copy link
Collaborator

Alright, as a sidenote, the issue is raised because with plugin-sass@0.4.0 works

Do you mean plugin-sass? Hm I don't know what the do differently. Maybe we should look and compare it with this repo? Unfortunately I have no experience with TypeScript so I can't help you out with your problem 😕 (I think this error is related to TypeScript because it can't parse my script)

this is not necessary with the meta *.scss wildcard on my systemJS config.

Oh sorry, I oversight that 😔

@lifenautjoe
Copy link
Author

Nope, with this library, on this release, works,unintentionally, but it does.

I'll look into it and see what made it work before or made it fail now. I know TypeScript might not be a focus of the project but its a good to have for users.

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

No branches or pull requests

2 participants