question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Possible to use with Laravel and typescript?

See original GitHub issue

I have tried many setups but these warnings when using with Laravel project running yarn dev and this error:

app.js:151605 Uncaught TypeError: twin_macro__WEBPACK_IMPORTED_MODULE_1___default.a.div is not a function

Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
 @ ./node_modules/twin.macro/macro.js
 @ ./resources/ts/components/Calender.tsx
 @ ./resources/ts/app.ts
 @ multi ./resources/ts/app.ts ./resources/css/app.css

WARNING in ./node_modules/twin.macro/macro.js 41:61-80
Critical dependency: the request of a dependency is an expression
 @ ./resources/ts/components/Calender.tsx
 @ ./resources/ts/app.ts
 @ multi ./resources/ts/app.ts ./resources/css/app.css

WARNING in ./node_modules/import-fresh/index.js 31:31-48
Critical dependency: the request of a dependency is an expression
 @ ./node_modules/babel-plugin-macros/node_modules/cosmiconfig/dist/loaders.js
 @ ./node_modules/babel-plugin-macros/node_modules/cosmiconfig/dist/index.js
 @ ./node_modules/babel-plugin-macros/dist/index.js
 @ ./node_modules/twin.macro/macro.js
 @ ./resources/ts/components/Calender.tsx
 @ ./resources/ts/app.ts
 @ multi ./resources/ts/app.ts ./resources/css/app.css```

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
laclancecommented, Jun 22, 2020

Cool thanks for your help and the awesome library 😃 Yeah I’m surprised Laravel hasn’t switch to use babel or added a way to do it, I guess they don’t have enough typescript users yet.

1reaction
laclancecommented, Jun 20, 2020

I think the problem is babel macros do not work with ts-loader so I got it working with laravel-mix using babel-loader instead by using laravel-mix-react-typescript-extension.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Typescript with Laravel
TypeScript provides optional static typing, which lets you structure and validate your code at the compilation stage. It also brings the IDE ...
Read more >
TypeScript with Laravel Mix - Sebastian De Deyne
TypeScript with Laravel Mix · 1) Install The Necessary Dependencies · 2) Configure TypeScript · 3) Configure Laravel Mix · 4) Write Some...
Read more >
How to install & use ReactJS in TypeScript with Laravel 8 ...
We can start by scaffolding a new laravel app using the command: laravel new larareacts. Install typescript globally on your local machine:.
Read more >
Laravel mix TypeScript setup - Floyk
Laravel mix TypeScript setup · 1. Step - create tsconfig.json · 2. Step - create app.ts and config webpack.mix.js · 3. Install ts-loader...
Read more >
How to use Typescript in Laravel Project with Vue as frontend?
How to use Typescript in Laravel Project with Vue as frontend? · Initialize your project · Add Typescript Support · Finally build the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found