1602 / 1602/compound

Bug with assets compiler

Offen
#647 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
1.6k
Forks
179
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

I am getting this error when I set a dot (.) in the end of the url:

Url: `http://example.com/some_url.`

```
Express
500 TypeError: Cannot read property 'destDir' of undefined
at AssetsCompiler.handleRequest (/var/www/youtube-vasea/node_modules/co-assets-compiler/lib/assets-compiler.js:118:62)
at Object.assetsCompiler [as handle] (/var/www/youtube-vasea/node_modules/co-assets-compiler/lib/assets-compiler.js:56:12)
at next (/var/www/youtube-vasea/node_modules/express/node_modules/connect/lib/proto.js:174:15)
at Object.expressInit [as handle] (/var/www/youtube-vasea/node_modules/express/lib/middleware.js:30:5)
at next (/var/www/youtube-vasea/node_modules/express/node_modules/connect/lib/proto.js:174:15)
at Object.query [as handle] (/var/www/youtube-vasea/node_modules/express/node_modules/connect/lib/middleware/query.js:43:5)
at next (/var/www/youtube-vasea/node_modules/express/node_modules/connect/lib/proto.js:174:15)
at Object.compound [as handle] (/var/www/youtube-vasea/node_modules/compound/lib/server/compound.js:27:13)
at next (/var/www/youtube-vasea/node_modules/express/node_modules/connect/lib/proto.js:174:15)
at Function.app.handle (/var/www/youtube-vasea/node_modules/express/node_modules/connect/lib/proto.js:182:3)
at Server.app (/var/www/youtube-vasea/node_modules/express/node_modules/connect/lib/connect.js:67:37)
at Server.EventEmitter.emit (events.js:98:17)
at HTTPParser.parser.onIncoming (http.js:2108:12)
at HTTPParser.parserOnHeadersComplete [as onHeadersComplete] (http.js:121:23)
at Socket.socket.ondata (http.js:1966:22)
at TCP.onread (net.js:525:27)
```

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

The error occurs in the assets-compiler module at line 118 when a URL ends with a dot. Start by examining the handleRequest method in node_modules/co-assets-compiler/lib/assets-compiler.js to see how the request path is parsed. Look for where destDir is accessed and why the object might be undefined. Check if there are existing tests for the assets compiler; if not, create a test case that reproduces the error with a trailing dot in the URL.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
express, javascript, node.js
Bereich
backend, tooling
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.