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.

Using babelInclude("node_modules/shared-lib") doesn't seem to work

See original GitHub issue

In my shared-lib, I have a file that uses class properties that should be compiled by babel like the example below:

class Shared-utils {
    someProp = () => {
        //do stuff
    }

export default Shared-utils

When I run npm start in my main project I get the following error:

SyntaxError: path-to-shared-lib/Shared-utiles.js: Support for the experimental syntax 'classProperties' isn't currently enabled (8:9):
...
Add @babel/plugin-proposal-class-properties (https://git.io/vb4SL) to the 'plugins' section of your Babel config to enable transformation.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8

github_iconTop GitHub Comments

2reactions
doronodedcommented, Feb 24, 2019

Hey, I figured it out… You can use fs.realpathSync("../../node_modules/@project/comp-one") instead of path.resolve("../../node_modules/@project/comp-one")

It solved my problem.

1reaction
doronodedcommented, Feb 19, 2019

Yes, its because its a seemlink! Any suggestions?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Include some node_modules directories in Babel 7
I finally got this to work. package.json { "name": "someproject", "version": "1.0.0", "description": "", "main": "index.js", "browserslist": "> 0.25% in DE, ...
Read more >
Things I wish I had known when I started JavaScript monorepo ...
Monorepo must have a mechanism how to interconnect packages and allow us to use one package code within another. Dependency management.
Read more >
Three Ways to Share Node.js Modules Across Multiple Projects
Option 1: Link to a Local Project Folder ... Once you've moved your shared code into a separate project, link the project as...
Read more >
Why and how to transpile dependencies of your JavaScript ...
CommonJS variant that doesn't use modern features of JavaScript such ... usage examples for Babel and babel-loader to exclude node_modules ...
Read more >
Babel doesn't see shared lib - Serverless Forums
Hello, my project is structured: ~/myproj |- node_modules |- lib |- shared.js |- service1 | - serverless.yml | - webpack.config.js ...
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