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

Basis server crashes when "b:svg" is used with empty sprite path. #23

Open
sm0g opened this issue Apr 8, 2017 · 0 comments
Open

Basis server crashes when "b:svg" is used with empty sprite path. #23

sm0g opened this issue Apr 8, 2017 · 0 comments

Comments

@sm0g
Copy link

sm0g commented Apr 8, 2017

OS: Mac OS X El Capitan 10.11.6
Browser: Firefox 52.0.2 (64 bit)
Basis tools: 1.10.2

Steps:

  1. Use SVG sprites file explicitly: basis.resource('/app/ui/base/svg/sprites.svg').fetch().startUse();
  2. Use SVG symbol in a template: <b:svg use="#icon-calendar"/> or <b:svg src="/app/ui/base/svg/sprites.svg" use="#icon-calendar"/>
  3. Important note. basis server rewrite rule is used:
    "^/folder/(.*)$": "http://localhost:8099/index.html [P, QSA]"
  4. It works fine if use "http://localhost:8099" url but crashes in case of "http://localhost:8099/folder/123"

Please see https://github.com/sm0g/basis-server-issue as an example.

Expect to see an icon but basis server crashes. Please see logs:

path.js:7
    throw new TypeError('Path must be a string. Received ' + inspect(path));
    ^

TypeError: Path must be a string. Received null
    at assertPath (path.js:7:11)
    at Object.join (path.js:1211:7)
    at absolutePath (/usr/local/lib/node_modules/basisjs-tools/lib/server/modules/files.js:226:34)
    at Object.absolutePath (/usr/local/lib/node_modules/basisjs-tools/lib/server/modules/files.js:233:12)
    at resolvePathnameFile (/usr/local/lib/node_modules/basisjs-tools/lib/server/modules/http-server.js:193:26)
    at Object.defaultRequestHandler [as fn] (/usr/local/lib/node_modules/basisjs-tools/lib/server/modules/http-server.js:275:5)
    at processRequest (/usr/local/lib/node_modules/basisjs-tools/lib/server/modules/http-server.js:324:16)
    at next (/usr/local/lib/node_modules/basisjs-tools/lib/server/modules/http-server.js:326:9)
    at Object.virtualPathMiddleware [as fn] (/usr/local/lib/node_modules/basisjs-tools/lib/server/modules/http/virtualPath.js:37:16)
    at processRequest (/usr/local/lib/node_modules/basisjs-tools/lib/server/modules/http-server.js:324:16)

P.S.
It works normally in Chrome and IE11.
In build mode icon is just not displayed.

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