question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'url' property is deprecated - question

See original GitHub issue

I am using withRouter HoC as described in this snippet, however, I am still getting the error:

 utils.js:26 Warning: the 'url' property is deprecated. https://err.sh/next.js/url-deprecated
  • [x ] I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

Code executes without the deprecation warning.

Current Behavior

The error mentioned above appears.

Steps to Reproduce (for bugs)

  1. Import withRouter to your component
  2. Refer any field from this.props.router
  3. Export your component wrapped in withRouter HoC
  4. When component is rendered, the deprecation error appears in console

Context

I am implementing Navigation component that is aware of the current route (to highlight the NavItem).

Your Environment

Tech Version
next 6.0.0
node 9.11.1
OS OSX 10.13.4
browser Chrome Version 66.0.3359.139

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:12
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

5reactions
timneutkenscommented, Jun 21, 2018

I’ve removed the suggestions in this thread saying you should create a custom _app.js that passes in the url property globally, as the reason we removed it is to be more explicit and not pass in url as a property, but instead you can inject the router using withRouter() as per the deprecation. We will provide a codemod soon to update url in pages to the withRouter() implementation automatically.

4reactions
ryanfitzercommented, Jun 6, 2018

One of my child components triggers the warning with JSON.stringify( this.props ).

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - Hey can you help me out . my 'url.parse' is deprecated
The signature '(urlStr: string): UrlWithStringQuery' of 'url. parse' is deprecated url . The declaration was marked as deprecated here. Can you ...
Read more >
url-deprecated | Next.js
Url is deprecated​​ Having a magical url property coming out of nowhere doesn't aid that goal. ⚠️ In some cases using React Dev...
Read more >
Survey123WebFormOptions | ArcGIS Survey123
Deprecated in version 3.14, use questionValue instead. globalId ... Set this property to true and the web form will not send data to...
Read more >
Deprecations Added in Ember 3.x
As part of supporting ES5 getter computed properties, assigning computed properties directly is deprecated. You should replace these assignments with calls ...
Read more >
String.prototype.link() - JavaScript - MDN Web Docs
Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found