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.

Fix transformer blowing up when transforming imported variables

See original GitHub issue

See: https://github.com/madou/untitled-css-in-js-project/pull/22

It’s blowing up when iterating through the JSX attributes (className doesn’t have a parent = blows up).

Need to understand why - if it’s a bug - and if we can work around it. It works fine in tests - blows up when running storybook/webpack/ts-loader though.


Found this https://github.com/longlho/ts-transform-css-modules - should be good reference.

Edit: Or not because it follows css files not typescript. Meh.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
marioneblcommented, Dec 23, 2019

do you have any experience with accessing variables through module boundaries? atm it looks like i need to run transpileOnly: false to get TS to actually resolve the imports - and if i do that i run into all of these problems

Yes we did that quite a lot when working on the analyzer for Alva: https://github.com/meetalva/alva/tree/master/packages/analyzer/src. If I recall correctly we took a lot of inspiration from the way ts-morph does it:

https://github.com/dsherret/ts-morph/blob/439a0d5372810b9636c58e711f7454edeae16862/packages/ts-morph/src/utils/compiler/ModuleUtils.ts#L13

0reactions
marioneblcommented, Jan 1, 2020

would you be able to raise a bug on ts-loader with this info? you’ve been such a great help thank so much - just merged the fix to master

sure, will do that tomorrow!

Read more comments on GitHub >

github_iconTop Results From Across the Web

typescript-transformer-handbook/README.md at master
A comprehensive handbook on how to create transformers for TypeScript with code examples - typescript-transformer-handbook/README.md at master ...
Read more >
SyntaxError: Cannot use import statement outside a module ...
But Jest won't transform the module to plain javascript somehow. The error I get is. /Users/me/dev/Project/project/node_modules/variables/src/ ...
Read more >
5. Preprocessing Categorical Features and Column Transformer
Use ColumnTransformer to build all our transformations together into one object and use it with scikit-learn pipelines. Explain why text data needs a...
Read more >
Publication of a Report on the Effect of Imports of Transformers ...
In particular, this investigation focuses on transformers and transformer components (i.e., laminations and cores) for which the crucial input ...
Read more >
Transform Data - Amazon SageMaker - AWS Documentation
You can use the following procedure to group by a time series column. Open your Data Wrangler data flow. If you haven't imported...
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