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

Cannot read property 'ts' of undefined` (undefined = mixGlob) #1

Closed
Venipa opened this issue Apr 22, 2019 · 7 comments
Closed

Cannot read property 'ts' of undefined` (undefined = mixGlob) #1

Venipa opened this issue Apr 22, 2019 · 7 comments
Assignees

Comments

@Venipa
Copy link
Contributor

Venipa commented Apr 22, 2019

did exactly as told, using latest laravel-mix
TypeError: Cannot read property 'ts' of undefined

@Venipa
Copy link
Contributor Author

Venipa commented Apr 22, 2019

though that was said that the mapping is defaulted it is not.

@Venipa Venipa closed this as completed Apr 22, 2019
@MohamedLamineAllal
Copy link
Owner

MohamedLamineAllal commented Apr 24, 2019

@Venipa Sorry didn't see that. Can you provide a log. Where the error reside. For the mapping it is provided by default. By function mapping. {ts: {mapExt: 'js'}}. I confirm that. I have no problem with ts in linux. And that before the changment and the features that i come to add. Not published yet. I will tomorrow. Check the doc again as it will be updated. For the bug above i really like to get more details so i can work on it. Error log + your webpack.mix.js config. Looking forward.

@MohamedLamineAllal
Copy link
Owner

MohamedLamineAllal commented Apr 26, 2019

closed as it work for me. And there is no more data. (@Venipa waiting for your data)

@iamntz
Copy link

iamntz commented Jul 26, 2019

@MohamedLamineAllal: i have the exact same issue (althoug is not TS related):

// the complete webpack.mix.js file
const mix = require('laravel-mix');
const MixGlob = require('laravel-mix-glob');


const mix2 = MixGlob({mix})

console.log(mix2);
console.log('=======================');

What I expect is to see that mix2 be anything but... undefined:

  MixGlob:debug   'npm_config_cache_min',
  MixGlob:debug   'npm_config_cafile',
  MixGlob:debug   'npm_config_cert',
  MixGlob:debug   'npm_config_cidr',
  MixGlob:debug   'npm_config_color',
  MixGlob:debug   ... 203 more items ] +7ms
  MixGlob Mix glob +0ms
undefined
=======================

From this point on, it's obvious that any method will fail.

@donotfold
Copy link

I had the same issue. You have to add the new keyword to fix it.

Your example:

const mix = require('laravel-mix');
const MixGlob = require('laravel-mix-glob');

const mix2 = new MixGlob({ mix })
console.log(mix2);

This should log the result as you expected and execute the code without an error.

@MohamedLamineAllal
Copy link
Owner

MohamedLamineAllal commented Oct 3, 2019

Sorry folks i was busy and i didn't check. I just updated the documentation as by this issue.
#5 (comment)
It was my stupid mistake. Within the doc there were part where i used new MixGlob() and in other i forget new. And badly it was the first example. It's updated now.
(now i understand what the initial issue was about. I was like mmm. There is no such a thing.)

@MohamedLamineAllal
Copy link
Owner

@donotfold @iamntz would you be interested to be added as contributors. Having more hands will be appreciated. And you'll be more free to help and add things.

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

No branches or pull requests

4 participants