Why do the recommended import statements for Docusaurus fail? - docusaurus

Importing react components into a Docusaurus markdown file has a common pattern like:
import Figure from '#site/src/components/figure' github source
import BrowserWindow from '#site/src/components/BrowserWindow' official docs
However, this pattern throws an error in my application when I include the following line in docs/theirlabel/latest.md:
import Figure from '#site/src/components/figure'
Throwing the following error
ERROR in ./docs/theirlabel/latest.md 1:991-1039
Module not found: Error: Can't resolve '#site/src/components/figure'
in '/home/projects/github-5c7qs5-wquhko/docs/theirlabel'
Commenting that line allows the site to compile correctly.
I've tried many variations of referencing/including the figure.jsx component without success, like:
import Figure from '/src/components/figure'
import Figure from './src/components/figure'
import Figure from '../src/components/figure'
import Figure from 'src/components/figure'
import Figure from './figure'
import Figure from '/figure'
Any ideas what I'm doing wrong?

Related

Use flipbook-vue in Nuxt 2 application

Hello im trying to add flipbook-vue to my Nuxt application but im getting weird error that i cant even import it.
Here is reproduction: https://stackblitz.com/edit/nuxt-starter-playground-gckgi7?file=plugins%2Fflipbook.js
import Flipbook from 'flipbook-vue/vue2' gives this error:
I have to import it like this to make it work:
import Flipbook from 'flipbook-vue/dist/vue2/flipbook.mjs

import "tensorflow.keras.applications" could not be resolved (reportMissingImports) in google-colaboratory

I am trying to import tensorflow.keras.applications in Google Colab. The imported module works fine. There is no compilation error. But, I am being shown a yellow curved underline, kind of a warning.
Error:
What is the problem that leads to such a warning?
Thank you.
You are not the only one experiencing this, and it does not happen only in Google Colab. It is a bug in Tensorflow.
Since it is just a warning you could ignore it. However if you like having code completion like I do you can substitute your imports from this:
import tensorflow.keras.x
To this:
import keras.api._v2.keras.x
Where x is the import you want to get.

React Naitve Error - Invariant Violation: ART has been removed from React Native

ART was imported from 'react-native' in the react-native-progress module.
import { Animated, ART, StyleSheet, View } from 'react-native';
I updated the module and now it imported from #react-native-community/art.
import { Surface as ARTSurface } from '#react-native-community/art';
ART is not used in the project anywhere else, yet I am still facing the same error.
Any idea what's wrong?
Error Message:
Invariant Violation: ART has been removed from React Native. It can now be installed and imported from '#react-native-community/art' instead of 'react-native'. See https://github.com/react-native-community/art.
Screenshot of the error.
By looking at your stack trace, You are using react-native-progress and this is an internal dependency of it and that's why you are facing this issue.
According to docs of react-native-progress.
https://github.com/oblador/react-native-progress/blob/master/README.md#reactart-based-components
So according to docs, you can remove it too for fixing this error.
Note: If you don't want the ReactART-based components and their dependencies, do a deep require instead: import ProgressBar from 'react-native-progress/Bar';.
So either you can avoid using these components which are ART based or try to fix them like below.
in file Circle.js, CircleSnail.js, Pie.js,
replace ART.Surface with
import {Surface} from '#react-native-community/art';
and in file Shapes/Arc.js
import {Shape, Path} from '#react-native-community/art';
and replace the same above.
Any package relies on ART will cause the issue with you , not only react-native-progress , but also packages with loaders like this react-native-loading-spinner-overlay ,
You can change this by finding another package of by fixing your imports
The Art library has been removed as of SDK 36 ,
If you need to use react-native-progress, which relies on ART, you can use the bare workflow and install #react-native-community/art, or implement your own progress indicator using Svg

How do I use a heatmap with vue highcharts?

I tried using heatmap as the chart type but I am getting error 17. I am using vue-highcharts and wondering how I can fix this proble. I looked online and it seems that I may have to import it and use it. Can anyone show me how to do that because I can't find any documentation on it?
import HighCharts from 'highcharts'
import heatmap from 'highcharts/modules/heatmap';
heatmap(HighCharts);
These are the import statements for it to work.

Getting "undefined is not an object (evaluating '_react2.proptypes.string')" after importing react-native-prompt

I am using the newest version of NPM, the version of exp is 57.0.0. When I add to my code in render method, I get an error "undefined is not an object (evaluating '_react2.proptypes.string')". Without adding everything works perfect.
Both Prop-Types and React-native-prompt are installed.
I have already tried to write import Prompt from 'prop-types'; instead of writing import Prompt from 'react-native-prompt'; but then I am getting the error that hasn't been found in Prop-Types.
Any suggestions on how to fix it?
Thank you
PropTypes moved into separate package. Use prop-types package.
react-native-prompt use outdated style of prop-types so you have to manually solve it.
go to /node-modules/react-native-prompt and edit main files in this way:
import { PropTypes } from 'react'
the above line is incorrect and must be like this:
import PropTypes from 'prop-types'
You have to import PropTypes in this way.
More info here.
Note:
React.PropTypes has moved into a different package since React v15.5. Please use the prop-types library instead. We provide a codemod script to automate the conversion.