Parcel: Can't parse React link parameters with points

Created on 10 Apr 2018  Β·  4Comments  Β·  Source: parcel-bundler/parcel

Choose one: is this a πŸ› bug report or πŸ™‹ feature request?

πŸŽ› Configuration (.babelrc, package.json, cli command)

// .babelrc
{
    "presets": [
      "react-app", "env", "stage-2"
    ],
    "plugins": ["transform-class-properties", "transform-decorators-legacy"] 
}
// package.json
"scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "parcel index.html",
    "build": "parcel build index.html"
  }

πŸ€” Expected Behavior

😯 Current Behavior


Hello, very good tool.
Here are the problems I encountered. When I visit localhost:1234?a=., the page does not open. But parameter a can open normally if it is not dotted.

πŸ’ Possible Solution

πŸ”¦ Context


I searched on google for a long time and did not find a solution, so I’m looking for help here

πŸ’» Code Sample


My code is very simple

// index.html
<html>
<title>δΌ ζ’­ε›Ύ</title>
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
<script src="https://d3js.org/d3.v4.min.js"></script>
<body>
    <div id="root">

    </div>
    <script src="./index.js"></script>
</body>
</html>

// index.js
import React from 'react';
import ReactDOM from 'react-dom';
import App from './src/app';
import './index.less';

ReactDOM.render(<App />, document.getElementById('root'));


if (module.hot) {
    module.hot.accept();
}

// app.js
import React from 'react';
import Layout from './components/Layout';
import Spread from './views/spread';
class App extends React.Component {

    render() {
        return (
            <div>test</div>
        )
    }
}

export default App;

🌍 Your Environment

| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | 1.7
| Node | 9.2
| npm/Yarn | 5.5
| Operating System | mac 10.12

Good First Issue Bug

All 4 comments

This is probably an issue with the server, which gathers the extensions, and probably sees the . as an extension therefore using that instead of the real extension.
Should be fairly easy to fix if that's the case

I actually also had this problem recently. #1169 should fix it. Let me know!

Good job!!! When will a new version be released?

I'll try to do a patch release later today.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

philipodev picture philipodev  Β·  3Comments

Niggler picture Niggler  Β·  3Comments

jsftw86 picture jsftw86  Β·  3Comments

davidnagli picture davidnagli  Β·  3Comments

will-stone picture will-stone  Β·  3Comments