kwelch / babel-plugin-captains-log

Babel plugin that injects helpful details into console statements
MIT License
85 stars 5 forks source link

Cannot find module 'babel-runtime/helpers/typeof' #22

Closed mqklin closed 5 years ago

mqklin commented 5 years ago

After upgrading webpack, @babel/core and babel-loader to the latest version I catch this error. I can provide a repro if it's necessary, but I think it's easy to reproduce

kwelch commented 5 years ago

This is probably since I have not updated to the latest babel. I will try to get an update out that uses babel@7, by the end of the week.

kwelch commented 5 years ago

I have started a branch, but I am running through a few issues with the upgrade. https://github.com/kwelch/babel-plugin-captains-log/tree/update-packages

1) Filename is not defaulting as it was. 2) "use strict"; is being injected to the top of the tests throwing off the snapshots

mqklin commented 5 years ago

Sorry, I'm not familiar with babel and don't know how to write plugins. I hope some day I'll learn how to do it, but now I prefer to support OS with opencollective (as much as I can afford). If you create account there, I'll tip a few bucks to you :) Because it's very useful for debugging, we use it every day (because we are debugging every day:))

kwelch commented 5 years ago

I have just published a beta version 1.2.0-beta.1. Can you install that and let me know if it resolves your error.

My tests are still failing locally, but I tested it in a local repo and it was fine, so I may just have to live with the tests as is.

I have tagged it as beta, so you should be able to: npm install babel-plugin-captains-log --tag beta

mqklin commented 5 years ago

Now it says ERROR in ./src/index.js Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: Cannot find module 'babel-plugin-captains-log'. But with the old version the error is Error: Cannot find module 'babel-runtime/helpers/typeof', so I'm sure I've installed beta package correctly.

kwelch commented 5 years ago

Is the plugin properly located in your node modules?

I thought I had it working with another repo.

I am on vacation but I will try to put some more time into this

kwelch commented 5 years ago

I pushed a branch of a different repo of mine that I used to test the beta.

https://github.com/kwelch/da-bomb/tree/captain-log-test

I ran this to install.

npm install babel-plugin-captains-log --tag beta -D

kwelch commented 5 years ago

@mqklin Could you try the install again.

mqklin commented 5 years ago

Sorry for the delay. I'll do it this week

kwelch commented 5 years ago

No worries! I want to make sure it works and I assume if it is not working for you it could be breaking for others. Thanks for helping test!

mqklin commented 5 years ago

Sorry, didn't have time =/ Will try to see this week. I want to setup it from scratch, because in my project I still get this error: Error: Cannot find module 'babel-plugin-captains-log' (I'm installing it with yarn add -D babel-plugin-captains-log@beta)

mqklin commented 5 years ago

@kwelch if I run yarn add babel-plugin-captains-log@beta, my node_modules/babel-plugin-captains-log folder has no dist folder: image

But if I install it with npm, it has. But I can't use npm, because we use yarn in our project.

kwelch commented 5 years ago

oh wow that is very odd. I will try to replicate. Thanks!

kwelch commented 5 years ago

I found the issue with that deployment and have republished under the beta tag.

You should be able to re-install and have it work properly.

mqklin commented 5 years ago

It works now! Thanks a lot! Will you publish it as a release? Or should we use beta?

kwelch commented 5 years ago

I will merge this and publish a real release.

kwelch commented 5 years ago

This was resolved and pushed with c467ac784a52de644db7d14b5ee52036819a029d and v1.2.0