sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

require('./config/docs.config.html'); now returns object in GA rather than string like RC0

Open weshackett opened this issue 9 years ago • 6 comments

Thank you for reporting an issue or suggesting an enhancement. We appreciate your feedback - to help the team to understand your needs, please complete the below template to ensure we have the necessary details to assist you.

Category

  • [ ] Question
  • [ ] Typo
  • [ X] Bug
  • [ ] Enhancement / Suggestion
  • [ ] Additional article idea

Expected or Desired Behavior

var gg = require('./config/docs.config.html'); should return the string of the contents.

Observed Behavior

RC0 require would return html files as string, in GA it now returns an object.

Steps to Reproduce

Use the above in an angularjs angular.ui.router example

$stateProvider .state('config', { template: require('./config/docs.config.html'), params: { displayMode: undefined }, controller: 'DocsConfigController', controllerAs: 'vm'

};

This code complied ok in RC0 now in GA it complains the require is an object rather than string.

weshackett avatar Feb 27 '17 11:02 weshackett

var gg = require('./config/docs.config.html');

Will work, its mainly this behaviour wasn't captured in the release notes as far as I can see.

weshackett avatar Feb 27 '17 11:02 weshackett

This is probably because we updated the webpack-env typings. Is this a Typescript issue or a runtime issue?

If it's a typescript issue, try saying var gg = require<string>('./config/docs.config.html');.

iclanton avatar Feb 27 '17 18:02 iclanton

Yeah that works fine, it should probably get added to the release notes though. Save someone re-raising it as a bug in here.

weshackett avatar Feb 28 '17 13:02 weshackett

@patmill - can you take care of documenting this?

iclanton avatar Feb 28 '17 23:02 iclanton

Done. Thanks @weshackett

patmill avatar Mar 01 '17 18:03 patmill

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

msft-github-bot avatar Jan 29 '20 18:01 msft-github-bot