Comments (8)
Man. There is one thing I hate more than webpack. It is the whole React infrastructure. They ruin JavaScript for everyone else.
Package html-to-text has been ignored because it contains invalid configuration. Reason: Package subpath './package.json' is not defined by "exports" in /<project path>/node_modules/html-to-text/package.json
What?
* /<project path>/node_modules/html-to-text/lib/html-to-text.cjs(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)
It doesn't recognize cjs
as a valid extension and doesn't check "extensionless" file either.
Especially confusing since from the previous warning we can conclude it knows about exports so it can't be that old.
If there is a way to configure it in your project to recognize additional file extension - that should solve this.
Alternatively, you can try html-to-text
8.2.1 - before it switched to dual mode.
Overall, this seems to be an issue of React Native specifically or React pipeline as a whole.
I'm not qualified to help with it.
If you can debug the issue and explain what is missing - I can include the changes unless they cause inconveniences elsewhere.
from node-html-to-text.
Relevant issues:
thysultan/stylis#233
emotion-js/emotion#1986
https://www.reddit.com/r/expo/comments/w14tjo/unable_to_resolve_module_cjs/
Looks like there is a way to provide additional file extensions.
If metro
bundler is used, then it should be resolved in version 0.72.0:
facebook/metro#535
from node-html-to-text.
Thanks @KillyMXI ,
Using 8.2.1
did clear that error, but gave me a new, similar looking one:
Error: While trying to resolve module `@selderee/plugin-htmlparser2` from file `/<project path>/node_modules/html-to-text/lib/html-to-text.js`, the package `/<project path>/node_modules/html-to-text/node_modules/@selderee/plugin-htmlparser2/package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`/<project path>/node_modules/html-to-text/node_modules/@selderee/plugin-htmlparser2/lib/hp2-builder.cjs`. Indeed, none of these files exist:
* /<project path>/node_modules/@selderee/plugin-htmlparser2/lib/hp2-builder.cjs(.native|.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)
* /<project path>/node_modules/html-to-text/node_modules/@selderee/plugin-htmlparser2/lib/hp2-builder.cjs/index(.native|.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)
They absolutely do exist. I've tried all versions of @selderee/plugin-htmlparser2
in html-to-text
's package.json
but it didn't help.
The project I'm working on is quite old, and managing the dependencies is proving difficult, so I'll look at a cruder solution as the incoming HTML is fairly static.
Thank you very much for your time.
from node-html-to-text.
Ah right, I forgot the bundler will have to deal with all my upstream packages as well.
If you can't update the bundler itself, another way might be, perhaps, to bundle problematic dependency first by other means and use that.
Not sure if something like https://esm.sh/ can do that for you.
from node-html-to-text.
Success! The steps to solve for me were:
- Use version
8.2.1
- Add a
resolver.sourceExts
tometro.config.js
which includedcjs
andmjs
in the list of extensions
Thank you very much for your help with this. Its saved me lots of work maintaining two strings in parallel.
from node-html-to-text.
I'm curious whether version 9 works with resolver.sourceExts
as well, or what kind of error you get otherwise (and what version of metro you're working with).
from node-html-to-text.
With 9.0.5
when running npx react-native start
, npx react-native run-android
or npx react-native run-ios
I get the warning:
Package html-to-text has been ignored because it contains invalid configuration. Reason: Package subpath './package.json' is not defined by "exports" in /<project path>/node_modules/html-to-text/package.json
The project uses react-native 0.62.2
... is that the metro version?... I'm not sure.
from node-html-to-text.
So it runs, just has this warning?
I found this issue: uuidjs/uuid#444
and this comment: ai/nanoevents#44 (comment)
Looks like I can add "./package.json": "./package.json"
to my exports whenever I will be releasing the next version, but it shouldn't affect the functionality in any way other than this warning, so no need to hurry.
If metro is in the dependency tree, then it should be possible to find it in node_modules
or in package-lock.json
.
from node-html-to-text.
Related Issues (20)
- Encoding issue HOT 1
- Scraper options selector skip doesnt work HOT 2
- h1 and P are conflicting HOT 2
- how to convert url to markdown ? HOT 5
- tableToString(rows, formatOptions.rowSpacing ?? 0, formatOptions.colSpacing ?? 3), Unexpected token '?' HOT 2
- Is there a way to not parse images? HOT 1
- ul tag without text wrap HOT 2
- I can't use unorderedListItemPrefix for orderedList HOT 2
- Named export 'render' not found HOT 4
- How do you decode & convert in one pass? HOT 3
- TypeError: htmlToText.fromString is not a function HOT 5
- Cannot remove newlines between tags even with options HOT 1
- add typescript and support esm HOT 2
- Issue with selector: "*" HOT 2
- Convert a table into a markdown compatible table HOT 7
- Maximum call stack size exceeded RangeError: Maximum call stack size exceeded HOT 1
- Convert is not a function error HOT 2
- How do i prevent newlines when using whole page as a json object which should singleline HOT 2
- Preview extracted correctly, but actual content is missing HOT 2
- How to use html-to-text using cdn i.e. via <script> HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-html-to-text.