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.

Rollup bundling process does not handle "~" alias

See original GitHub issue

Describe the bug It looks like Rollup is not handling the ~ substitution with src folder path. This is ok when you inspect the dist folder generated inside the repo…but it fails to build inside a project which uses react-dnd-treeview as dependency.

I hope you can fix this…the library does a great job! 😃

To Reproduce Steps to reproduce the behavior:

  1. Add react-dnd-treeview as dependency in a TS project
  2. Navigate to the package folder inside node_modules
  3. Open any file that imports ~/types - i.e. /dist/hooks/useContainerClassName.d.ts(
  4. See screenshots

Expected behavior Transpiled files should contain ../src/ instead of ~

Screenshots Screenshot 2022-09-30 at 16 44 44

Screenshot 2022-09-30 at 16 51 37

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
leopuleocommented, Oct 5, 2022

Thanks @minop1205, just installed the alpha version and the project compiles!

Thank you for such a quick response.

1reaction
leopuleocommented, Oct 3, 2022

Hello @minop1205, thanks for such a quick reply.

To reproduce the error:

  1. Create a new react application (typescript) -> https://create-react-app.dev/docs/adding-typescript/
  2. Add react-dnd-treeview as a dependency and re-create the demo you listed on this repo.
  3. Inside tsconfig.json set skipLibCheck: false (or just delete the line)
  4. Run tsc command.

You should see the errors. Let me know if you need any other help.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Aliases not working while importing node modules #27 - GitHub
I am using preact-compat as an alias for react within my rollup config file. My plugin config is as below :- plugins: [...
Read more >
roll up bundle fails to map alias import - Stack Overflow
But i am having issue with import mapping in the bundle I build, since I am using Path aliases in my source code....
Read more >
rollup.js
Especially if you are bundling Rollup into another build tool or want to integrate it into an advanced build process, it may be...
Read more >
Rollup-plugin-alias - npm.io
Define aliases when bundling packages with Rollup. Let's take a simple import as an example: import something from '../../../something'; something();
Read more >
rollup-plugin-alias-fork - npm package - Snyk
Define aliases when bundling packages with Rollup. This is fork, which is done for the sake of working with all files, without adding...
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