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.

`Cannot find module 'raw.macro'` when upgrading from 0.4.2

See original GitHub issue

Had no other changes to my code. Very simple file:

import raw from "raw.macro";

const privacyPolicy = raw("./privacy_policy.md");

Works on 0.4.2 but not on 0.6.1.

babel-plugin-macros is at version 3.1.0.

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
soerfacecommented, Nov 5, 2022

@pveyes it seems to be broken again with 0.7.0.

npm i --save-dev raw.macro will refuse installation:

…
npm ERR! Could not resolve dependency:
npm ERR! peerOptional babel-plugin-macros@"^2.8.0" from raw.macro@0.7.0
npm ERR! node_modules/raw.macro
npm ERR!   dev raw.macro@"0.7.0" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: babel-plugin-macros@2.8.0
npm ERR! node_modules/babel-plugin-macros
npm ERR!   peerOptional babel-plugin-macros@"^2.8.0" from raw.macro@0.7.0
npm ERR!   node_modules/raw.macro
npm ERR!     dev raw.macro@"0.7.0" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution

If I retry with npm install --save-dev --legacy-peer-deps raw.macro, npm doesn’t complain anymore, but the package will not be found on application start (as described in the initial issue). But it will be listed in my package.json with "^0.7.0" and exists in node_modules in version 0.7.0.

However, I can make it work by running npm i --save-dev --legacy-peer-deps raw.macro@0.6.2

My env:

  • babel-plugin-macros: 3.1.0
  • node: 16.16.0
  • npm: 8.11.0
0reactions
pveyescommented, Aug 4, 2022

Awesome

If it still doesn’t work for some of you, please reopen this issue and share your env version

Read more comments on GitHub >

github_iconTop Results From Across the Web

raw.macro - npm
Read file contents at build time, similar to webpack raw-loader. ... Start using raw.macro in your project by running `npm i raw.macro`.
Read more >
Stopped working in Node 12 · Issue #19 · pveyes/raw.macro
nvm use 12 Now using node v12.1.0 (npm v6.9.0) $ npx babel src Error: raw.macro: Cannot find module './stuff.txt' Require stack: ...
Read more >
"Cannot find module" when using raw-loader and TypeScript
In my case with Next.js (also Typescript), I solved it by just installing raw-loader. Really. npm install raw-loader.
Read more >
npmsearchfullcat_npm143.txt - GitHub
=shiwano 2013-11-20 0.1.3 2ch 2co Module that will provide nodejs adapters ... Install this and see if you want to hire me :)...
Read more >
npm fails to install - Google Groups
n\nYou find elements by using a sub-set of WebDriver\'s element-finding strategies. ... 45 silly lockFile 71f07e56-sr-local-lib-node-modules-appium ...
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