Git Product home page Git Product logo

Comments (8)

mdevils avatar mdevils commented on August 30, 2024 1

@guptadeepanshu21 Try writing

console.log(require('html-entities/package.json').version);

to know what exact version you have installed right now.

from html-entities.

guptadeepanshu21 avatar guptadeepanshu21 commented on August 30, 2024

Are you able to import 'encode' directly from 'html-entities'.
I am getting following error :

export 'encode' (imported as 'encode') was not found in 'html-entities'

from html-entities.

mdevils avatar mdevils commented on August 30, 2024

Hello @meytin1337, encode accepts one of 3 types: string | undefined | null, not number. Escaping numbers is not needed, none of numbers have any characters to escape.

from html-entities.

mdevils avatar mdevils commented on August 30, 2024

Hello @guptadeepanshu21.

What version are you using? Can you also paste your code?

from html-entities.

guptadeepanshu21 avatar guptadeepanshu21 commented on August 30, 2024

Hi @mdevils,

Using the latest version only.

Webpack-dev-server is using html-entities as a dependency.
in webpack-dev-server, there is a file called overlay.js in which following piece of code is written:

import { encode } from 'html-entities'

when we build our project we get an error "export 'encode' (imported as 'encode') was not found in 'html-entities'"

When I tried to import it like import { Html4Entities } from 'html-entities' and used Html4Entities.encode, the error didn't occur.

and also I tried to use html-entities in my local JS project.
In VS code, when we try importing encode, intellisense doesn't show it as a suggestion but it shows as 'Html4Entities' .

Can you try to do the same ?

from html-entities.

mdevils avatar mdevils commented on August 30, 2024

@guptadeepanshu21

When I tried to import it like import { Html4Entities } from 'html-entities' and used Html4Entities.encode, the error didn't occur.

It means you have an older version of html-entities installed for some reason. Latest webpack-dev-server uses the latest version of html-entities: https://github.com/webpack/webpack-dev-server/blob/master/package.json#L53

from html-entities.

guptadeepanshu21 avatar guptadeepanshu21 commented on August 30, 2024

@mdevils Please check this. I installed the latest version just now.

image

from html-entities.

guptadeepanshu21 avatar guptadeepanshu21 commented on August 30, 2024

@mdevils you are correct, somehow webpack-dev-server is not getting the latest version. I will try to debug it.
Anyway, Thank you for helping.

from html-entities.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.