Skip to content

May I plugin swagger-editor to my angular web? #1689

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

Closed
yulogs opened this issue Mar 9, 2018 · 4 comments
Closed

May I plugin swagger-editor to my angular web? #1689

yulogs opened this issue Mar 9, 2018 · 4 comments
Assignees

Comments

@yulogs
Copy link

yulogs commented Mar 9, 2018

I want to plugin to my angular 5 web project, but not work,
I add swagger-editor to package.json like:
"swagger-editor-dist": "^3.3.1",

And import to my Component like:
`
import {SwaggerUIBundle, SwaggerUIStandalonePreset} from 'swagger-ui-dist';

ngAfterViewInit() {

    const editor = SwaggerEditorBundle({
        domNode: this.el.nativeElement.querySelector('.swagger-container'),
        layout: 'StandaloneLayout',
        presets: [
          SwaggerEditorStandalonePreset
        ]
    });
}

`
Then many error like:
Myproject\src\traverse doesn't exist

May I plugin swagger-editor to my angular web?

@shockey
Copy link
Contributor

shockey commented Mar 9, 2018

@yulogs yes, this should be working - what error messages are you seeing?

@yulogs
Copy link
Author

yulogs commented Mar 10, 2018

This is my error:

/MyProject/ERROR in ./node_modules/swagger-editor-dist/swagger-editor.js
Module not found: Error: Can't resolve 'brace' in '/MyProject/node_modules/swagger-editor-dist'
resolve 'brace' in '/MyProject/node_modules/swagger-editor-dist'
Parsed request is a module
using description file: /MyProject/node_modules/swagger-editor-dist/package.json (relative path: .)
Field 'browser' doesn't contain a valid alias configuration
after using description file: /MyProject/node_modules/swagger-editor-dist/package.json (relative path: .)
resolve as module
/MyProject/node_modules/swagger-editor-dist/node_modules doesn't exist or is not a directory
/MyProject/node_modules/node_modules doesn't exist or is not a directory
/MyProject/node_modules doesn't exist or is not a directory
/MyProject/node_modules doesn't exist or is not a directory
/MyProject/node_modules doesn't exist or is not a directory
/MyProject/node_modules doesn't exist or is not a directory
/MyProject/node_modules doesn't exist or is not a directory
/node_modules doesn't exist or is not a directory
looking for modules in /MyProject/node_modules
using description file: /MyProject/package.json (relative path: ./node_modules)
Field 'browser' doesn't contain a valid alias configuration
after using description file: /MyProject/package.json (relative path: ./node_modules)
using description file: /MyProject/package.json (relative path: ./node_modules/brace)
no extension
Field 'browser' doesn't contain a valid alias configuration
/MyProject/node_modules/brace doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
/MyProject/node_modules/brace.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
/MyProject/node_modules/brace.js doesn't exist
as directory
/MyProject/node_modules/brace doesn't exist
looking for modules in /MyProject/node_modules
using description file: /MyProject/package.json (relative path: ./node_modules)
Field 'browser' doesn't contain a valid alias configuration
after using description file: /MyProject/package.json (relative path: ./node_modules)
using description file: /MyProject/package.json (relative path: ./node_modules/brace)
no extension
Field 'browser' doesn't contain a valid alias configuration
/MyProject/node_modules/brace doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
/MyProject/node_modules/brace.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
/MyProject/node_modules/brace.js doesn't exist
as directory
/MyProject/node_modules/brace doesn't exist
looking for modules in /MyProject/src
using description file: /MyProject/package.json (relative path: ./src)
Field 'browser' doesn't contain a valid alias configuration
after using description file: /MyProject/package.json (relative path: ./src)
using description file: /MyProject/package.json (relative path: ./src/brace)
no extension
Field 'browser' doesn't contain a valid alias configuration
/MyProject/src/brace doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
/MyProject/src/brace.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
/MyProject/src/brace.js doesn't exist
as directory
/MyProject/src/brace doesn't exist
looking for modules in /MyProject/src
using description file: /MyProject/package.json (relative path: ./src)
Field 'browser' doesn't contain a valid alias configuration
after using description file: /MyProject/package.json (relative path: ./src)
using description file: /MyProject/package.json (relative path: ./src/brace)
no extension
Field 'browser' doesn't contain a valid alias configuration
/MyProject/src/brace doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
/MyProject/src/brace.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
/MyProject/src/brace.js doesn't exist
as directory
/MyProject/src/brace doesn't exist
[/MyProject/node_modules/swagger-editor-dist/node_modules]

@shockey
Copy link
Contributor

shockey commented Mar 27, 2018

Hey @yulogs, looks like this may be coming from Angular itself: angular/angular-cli#8036

@shockey
Copy link
Contributor

shockey commented Apr 10, 2018

Closing due to inactivity.

This is simply to keep our issue tracker clean - feel free to comment if there are any further thoughts or concerns, and we'll be happy to reopen this issue.

@shockey shockey closed this as completed Apr 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants