gandm / language-babel

ES2017, flow, React JSX and GraphQL grammar and transpilation for ATOM
https://atom.io/packages/language-babel
MIT License
476 stars 83 forks source link

`Callback must be a function` when using a custom tagged template grammar #525

Open pfgithub opened 5 years ago

pfgithub commented 5 years ago

Setting a custom tagged template grammar like csscustom:source.css and using it on a file

let csscustom = () => {};
csscustom`
a{
  color:#fff;
}
`;

produces a warning Callback must be a function and does not highlight the text differently

settings page with template literal grammar set image of code above callback must be a function

lasbian commented 5 years ago

Same issue...

tujoworker commented 5 years ago

By installing Node v10 (LTS) instead of using v12, I got rid of the warning message Callback must be a function. But my custom tagged template grammar extensions are currently not working on my new mac/atom setup.

lasbian commented 5 years ago

Was already running the v10 (LTS) :/

pyrou commented 5 years ago

Same issue here. Possible related issue: are gql code highlighted on your setup with following example ?

const typeDefs = gql`
  type Query {
    test: String
  }
`;

This highlight should be working without custom tagged template grammar, because shipped by default with the plugin, but is also not working anymore on my setup (OSX, tested with node 10, 11, 12).

waspeer commented 5 years ago

Same!

christiaanwesterbeek commented 5 years ago

Just for good measure, here's the error stack of Atom:

Uncaught (in promise) NodeError: Callback must be a function at makeCallback (fs.js:165:11) at Object.fs.unlink (fs.js:1048:14) at getTtlGrammarFiles.then.ttlGrammarFiles (/.../.atom/packages/language-babel/lib/create-ttl-grammar.js:260:12)

  NodeError @ internal/errors.js:157
  makeCallback @ fs.js:165
  fs.unlink @ fs.js:1048
  getTtlGrammarFiles.then.ttlGrammarFiles @ create-ttl-grammar.js? [sm]:271
  Promise.catch (async)    
  doesGrammarFileExist.then.ifFileExists @ create-ttl-grammar.js? [sm]:54
  Promise.then (async)    
  Promise @ create-ttl-grammar.js? [sm]:48
  createGrammar @ create-ttl-grammar.js? [sm]:46
  configChangedTimer.setTimeout @ create-ttl-grammar.js? [sm]:222

Related: https://github.com/gruntjs/grunt-contrib-jasmine/issues/266

Axedyson commented 4 years ago

The same problem occurs for me when setting the following tagged template grammar:

Anmærkning 2020-02-14 000454

paulobarcelos commented 4 years ago

This is still the case today... super frustrating. Having the same problem on a new mac, fresh installation of Atom and up to date language-babel package.

Navigatron commented 4 years ago

I am experiencing the same issue. Setting:

html:text.html.basic

Versions:

screenshot

tiffting commented 4 years ago

The same problem occurs for me when setting the following tagged template grammar:

Anmærkning 2020-02-14 000454

Experiencing similar issue with /* @html */:text.html.basic

eminvegan commented 3 years ago

I have the same issue with .mjs files using template literals. My plugin list is: atom-beautify busy-signal docblockr file-icons highlight-selected hyperclick ide-css intentions language-babel language-javascript-plus linter (maybe incompatible?) linter-eslint (maybe incompatible?) linter-jshint (maybe incompatible?) linter-ui-default (maybe incompatible?) remember-folds remote-ftp

bruns8234 commented 3 years ago

Problem still exists since now more than 2 years. Does anybody think it will be solved? I appreciate to get a solution because changing from VS Code to Atom does not get easier with such problems (I code in js and html and want to use this feature as an replacement for the ES6-html Plugin of VS-Code (which marks html in template strings).

tinbka commented 2 years ago

Same there since 3 years