question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing dependency isArray

See original GitHub issue

Q&A (please complete the following information)

  • OS: linux
  • Browser: any
  • Version: swagger-ui@3.21.0
  • Method of installation: npm
  • Swagger-UI version: swagger-ui@3.21.0
  • Swagger/OpenAPI version: n/a

Content & configuration

Example Swagger/OpenAPI definition:

n/a

Swagger-UI configuration options:

import SwaggerUI from 'swagger-ui'
import 'swagger-ui/dist/swagger-ui.css'

const ui = SwaggerUI({
	url: "/openapi.yaml",
	dom_id: '#swagger-ui',
	deepLinking: true,
	presets: [
		SwaggerUI.presets.apis
	],
	plugins: [
	],
	layout: "BaseLayout",
	validatorUrl: null
})

Describe the bug you’re encountering

Using parcel to build the script fails with:

node_modules/swagger-ui/dist/swagger-ui.js:8:32318: Cannot resolve dependency ‘isArray’

To reproduce…

Build swagger-ui@3.21.0 using Parcel with the above “Swagger-UI configuration options”.

Expected behavior

I expect it to build

Screenshots

Additional context or thoughts

I’ve fixed it on my personal setup by going into the package.json of swagger-ui and adding the dependency: "isarray": "^2.0.4",

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:6
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
leocabezacommented, Nov 16, 2021

This is happening to me with latest swagger-ui-react version 4.1.0:

Q&A (please complete the following information)

OS: macOs Browser: any Version: swagger-ui@3.21.0 Method of installation: npm Swagger-UI version: swagger-ui@4.1.0 Swagger/OpenAPI version: n/a

Content & configuration

Example Swagger/OpenAPI definition:

n/a

Swagger-UI configuration options:

import React from 'react';
import dynamic from 'next/dynamic';

const SwaggerUI = dynamic(
  () => import('swagger-ui-react'),
  { ssr: false }
);

import spec from '../swagger.yml';

const SwaggerComponent = () =>
  <SwaggerUI spec={spec} docExpansion="list" />

export default SwaggerComponent;


Describe the bug you’re encountering

Using nextjs to build the script fails with:

wait - compiling /_error… error - ./node_modules/swagger-ui-react/swagger-ui.js:8:19760 Module not found: Can’t resolve ‘isarray’

Import trace for requested module: ./node_modules/swagger-ui-react/index.js ./pages/index.jsx

To reproduce…

  • git clone https://github.com/leocabeza/smashbros-unofficial-api
  • npm install
  • npm run dev
  • In your browser, visit http://localhost:3000/

Expected behavior

I expect it to build

Screenshots image

Additional context or thoughts


0reactions
OnkelTemcommented, Feb 14, 2022

I’m getting it as well with swagger-ui-react 4.5.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Hook useEffect has a missing dependency ...
isArray (comments));` must be true. With that information you posted, there is no way comments becomes non-array type if res.data is an array....
Read more >
Top 5 depcheck Code Examples - Snyk
Learn more about how to use depcheck, based on depcheck code examples created from the most popular ways it is used in public...
Read more >
Configuring liferay-npm-bundler
The liferay-npm-bundler is configured via a .npmbundlerrc file placed in the portlet project's root folder. You can create a complete configuration manually ...
Read more >
dependencies JavaScript and Node.js code examples - Tabnine
isArray (dependencies)) { dependencies = [dependencies]; } dependencies. ... 'The decorator is missing dependency \'test\'.') } }) origin: fastify/fastify ...
Read more >
Understanding Dependencies in useEffect | Bits and Pieces
A deep dive into the dependencies array in React. ... that the effect will not run again if one of the omitted value...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found