Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

window not defined #3016

Closed
andrewcharnley opened this issue May 2, 2017 · 3 comments
Closed

window not defined #3016

andrewcharnley opened this issue May 2, 2017 · 3 comments

Comments

@andrewcharnley
Copy link

andrewcharnley commented May 2, 2017

Latest on npm (3.0.8). 3.0.7 is ok. Given it broke last week as well it needs mentioning this project is way too unstable for distribution with swagger-tools.

ERROR ReferenceError: window is not defined\n at Object.<anonymous> (/home/osboxes/git/lerna-repo/packages/process-rtx-api/node_modules/swagger-ui/dist/swagger-ui.js:1:3485)\n at t (/home/osboxes/git/lerna-repo/packages/process-rtx-api/node_modules/swagger-ui/dist/swagger-ui.js:1:2377)\n at Object.<anonymous> (/home/osboxes/git/lerna-repo/packages/process-rtx-api/node_modules/swagger-ui/dist/swagger-ui.js:1:2782)\n at t (/home/osboxes/git/lerna-repo/packages/process-rtx-api/node_modules/swagger-ui/dist/swagger-ui.js:1:2377)\n at /home/osboxes/git/lerna-repo/packages/process-rtx-api/node_modules/swagger-ui/dist/swagger-ui.js:1:2469\n at /home/osboxes/git/lerna-repo/packages/process-rtx-api/node_modules/swagger-ui/dist/swagger-ui.js:1:2474\n

@shockey
Copy link
Contributor

shockey commented May 2, 2017

@andrewcharnley Thanks for reporting this - sorry you're having issues.

I assume this is happening on page load? How are you using Swagger-UI? I need some more information in order to reproduce this.

@shockey
Copy link
Contributor

shockey commented May 2, 2017

Made a fix in anticipation of what the problem (almost surely) is.

It's worth noting that should only be cropping up when swagger-ui's core code is run in a non-browser environment. If swagger-tools is doing this, it's likely using the 3.x series wrong.

That said, my pending PR for this moves our version stamping code into the constructor, and shields it with the window guard we use for running our tests in Node.

@shockey
Copy link
Contributor

shockey commented May 2, 2017

Should be fixed - please reply if any issues linger.

Thanks!

dwasyluk added a commit to syscoin/swagger-ui that referenced this issue May 5, 2017
* swaggerui-master: (132 commits)
  enable configs plugin by default
  Rebuild dist
  fix swagger-api#2841
  Make the checkbox id more unique.
  Rebuild dist
  Fix swagger-api#3016
  removed semicolon
  preventDefault the form
  v3.0.8 (fixes swagger-api#2923 swagger-api#2889)
  Rebuild dist
  Increment swagger-client version
  Attach information to version object
  Fix swagger-api#3003
  updated searchbar sizing
  build
  remove object-assign dep ( which was missing from package.json )
  fix swagger-api#2870
  Fix typo in container classname
  fix eslint errors
  swagger-api#2844 fix accessCode flow
  ...

# Conflicts:
#	dist/swagger-ui-bundle.js
#	dist/swagger-ui-bundle.js.map
#	dist/swagger-ui-standalone-preset.js
#	dist/swagger-ui-standalone-preset.js.map
#	dist/swagger-ui.css
#	dist/swagger-ui.js
#	dist/swagger-ui.js.map
#	src/plugins/topbar/topbar.jsx
@lock lock bot locked and limited conversation to collaborators Jul 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants