dvtng / react-loading-skeleton

Create skeleton screens that automatically adapt to your app!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

create a library and import react-loading-skeleton, and then used this lib into another lib throws erorr

m-nathani opened this issue · comments

Describe the bug

while upgrading react-loading-skeleton, throws an error when used from a lib.

i have success upgraded and migrated dependencies to latest and exported my component in my-lib package it works while running directly into react-app. however when i am using my-lib inside another library it breaks with error

TypeError: Dt.span is not a function

however, skeleton-loading-react works perfect while directly importing or used from my-lib ,

this is the package.json for my-lib i created

  "name": "@umai/common",
  "version": "0.0.48-test.11",
  "files": [
    "dist"
  ],
  "main": "./dist/umai-common.umd.js",
  "module": "./dist/umai-common.mjs",
  "exports": {
    ".": {
      "import": "./dist/umai-common.umd.js",
      "require": "./dist/umai-common.mjs"
    },
    "./dist/style.css": "./dist/style.css"
  }, 
...

and this is the vite-config for the my-lib

      lib: {
        entry: path.resolve(__dirname, 'src/index.js'),
        name: 'Common',
        fileName: 'umai-common',
      },

To Reproduce
create a library and import react-loading-skeleton, and then used this lib into another lib, this setup was working before on v2 for me.. however v3 breaks.

Would love to hear your thoughts.. not sure if its a bug on which side...

Actual Behavior
Throws error below when the second lib used in a react-app

TypeError: Dt.span is not a function

Expected Behavior
It should work as expected from the second lib too...

Versions

  • react-loading-skeleton version: 3.3.1
  • Browser version: chrome 114.0.5735.106
  • react: 16.14.0
  • vite: 4.3.9

Please submit a runnable code example that reproduces the issue. It is not possible to investigate this issue with the information provided. Thank you