Mini Program npm package json reference how to break, the default does not support json dependency!

VM16832:1 thirdScriptError 
 sdk uncaught third Error 
 module "npm/entities/maps/xml.json.js" is not defined 
 Error: module "npm/entities/maps/xml.json.js" is not defined
    at require (http://127.0.0.1:33642/appservice/__dev__/WAService.js:22:7213)
    at http://127.0.0.1:33642/appservice/__dev__/WAService.js:22:7068
    at http://127.0.0.1:33642/appservice/npm/entities/lib/encode.js:1:470
    at require (http://127.0.0.1:33642/appservice/__dev__/WAService.js:22:7354)
    at http://127.0.0.1:33642/appservice/__dev__/WAService.js:22:7068
    at http://127.0.0.1:33642/appservice/npm/entities/index.js:1:447
    at require (http://127.0.0.1:33642/appservice/__dev__/WAService.js:22:7354)
    at http://127.0.0.1:33642/appservice/__dev__/WAService.js:22:7068
    at http://127.0.0.1:33642/appservice/npm/basic-xml2json/lib/index.js:5:16
    at require (http://127.0.0.1:33642/appservice/__dev__/WAService.js:22:7354)
Apr.07,2021

make your .json into .js

.
{
 "a" : 1
}

change it to:

module.exports = {
  a : 1
}

https://github.com/NaturalInt.

Menu